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: Thu, 14 May 2020 15:12:21 -0300

On Mon, May 11, 2020 at 2:26 PM Benno Schulenberg <address@hidden> wrote:
>
>
> Op 09-05-2020 om 18:30 schreef Marco Diego Aurélio Mesquita:
> > On Sat, May 9, 2020 at 5:41 AM Benno Schulenberg <address@hidden> wrote:
> >> 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.
>
> Negligible?!  The renumbering loop consisted of: one increment, one
> assignment, one stepping to the next item, and one check for NULL --
> roughly eight nanoseconds.  Now it is extended with: one check, two
> additions, one function call, that does another function call, that
> does an 'if' and returns zero (when not softwrapping) -- roughly
> twenty nanoseconds extra.  This means that the loop gets slower by
> a factor of more than *three*.  That is far from negligible.
>
> The absolute numbers don't matter much, it is the relative increase
> that disgusts me.
>

Ok. Agreed.

> > I didn't want to renumber before assigning these variables. I
> > considered that, at least in the future, they could influence chunk
> > numbering.
>
> The future will have to worry about itself.  For now things need to
> be done with the least amount of duplication of effort.
>

Ok. Agreed.

> > WRT whitespace, what should I add my nanorc so that these problems go away?
>
> Switch on brain.  Read twenty lines of code back, read twenty lines
> forward, then look at your code again and see how it differs.
>
> But if you can't think:
>
>   extendsyntax c color black,yellow,blink,toot,beep "(if|while)\("
>
> > Any forecast of when/if it will be committed?
>

These are quite offensive, but let's ignore it. I added

  extendsyntax c color black,yellow "(do|for|if|while)\("

to my .nanorc. Thanks for the advice.



reply via email to

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