nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: having a scroll bar also in softwrap mode


From: Marco Diego Aurélio Mesquita
Subject: Re: having a scroll bar also in softwrap mode
Date: Sat, 9 May 2020 13:30:54 -0300

On Sat, May 9, 2020 at 5:41 AM Benno Schulenberg <address@hidden> wrote:
>
>
> Op 07-05-2020 om 22:58 schreef Marco Diego Aurélio Mesquita:
> > Are you suggesting to renumber the buffer in redecorate_after_swtich
> > on the codition if (ISSET(SOFTWRAP)) ? If that is the case, then this
> > means there will be a renumbering every time buffers are switched,
> > right?
>
> Only when softwrap is on, which will not be the case for most people.
> Also, using softwrapping is slow anyway, so it doesn't matter much if
> it gets a bit slower.  The important thing is that the default case,
> the non-softwrap case, doesn't get slower.
>

Softwrap is my default. That's why I'd considered it getting slower
when switching buffers.

> > I think
> > there is an alternative: when SOFTWRAP is toggled, renumber only when
> > it is turned on and add a check in draw_scrollbar:
> >
> >   if (!ISSET(SCROLLBAR)) {
> >     totalrows = openfile->filebot->lineno;
> >     first_row = openfile->edittop->lineno;
> >   }
>
> The other way around, of course: the non-softwrap case should not be
> burdened with computations that are only needed for softwrapping.
>

Same as above.

> > I'm happy to see that we are finally getting close to something
> > acceptable.
>
> Far from it.  I don't like it that renumber_from() is burdened with
> something that is only needed for softwrapping.  Probably the chunk
> numbering should only be done in the softwrap case...
>

I think it is easy to ad  a check there but the extra computation
seems negligible anyway.

> > +     if (old_amount != number_of_chunks_in(openfile->current))
> > +             renumber_from(openfile->current);
>
> Of course also this code should not be included in the tiny version.
> When I make a remark about anything (in this case #ifdefs), apply it
> _everywhere_.
>

Sorry. I'll consider compiling with NANO_TINY defined next time it is required.

>
> > +                     if (!ISSET(SOFTWRAP))
> >                               openfile->firstcolumn = 0;
> > -                     } else
> > -                             thebar  = 0;
> > +
> > +                     thebar = (LINES > 5 && COLS > 9) ? 1 : 0;
> > +                     bardata = nrealloc(bardata, LINES * sizeof(int));
> >                       editwincols = COLS - margin - thebar;
> > +                     if(ISSET(SOFTWRAP))
> > +                             renumber_from(openfile->filetop);
>
> Come on.  There is already an 'if !softwrap' five lines back.  Use it!
> Also: whitespace again.
>

I didn't want to renumber before assigning these variables. I
considered that, at least in the future, they could influence chunk
numbering.

WRT whitespace, what should I add my nanorc so that these problems go away?

> To save myself more explaining, an edited patch is attached.
>

Cool! Any forecast of when/if it will be committed? There are some
changes/improvements (small, simple and unrelated to scrollbar, I
swear) I want to submit. Do I have to wait for the scrollbar to settle
before sending such changes to the mailing list?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]