nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] softwrap navigation overhaul, now breaking on whitespac


From: Benno Schulenberg
Subject: Re: [Nano-devel] softwrap navigation overhaul, now breaking on whitespace
Date: Fri, 10 Mar 2017 21:26:42 +0100

On Thu, Mar 9, 2017, at 01:14, David Ramsey wrote:
> we seem to have very different styles.  (Given our discussions here, it
> seems we also think in very different ways as well.)

True.  :)

> On Wed, Mar 8, 2017 at 2:12 PM, Benno Schulenberg
> <address@hidden> wrote:
> > And why not initiliaze was_column when it's [declared]?  It was that
> > way -- why change it?
> 
> If we're at the top or bottom of the screen,

At the top or bottom of the buffer, you mean.

> we don't move and just
> return.  If was_column is initialized to xplustabs(), we just scanned
> the entire line for nothing.  Considering we do enough line scanning
> just to determine which softwrapped chunk we're in, I figured a bit of
> optimization was in order.

Well, how often will the user press <Up> or <Down> when already
at top or bottom?  Not very often.  But even it happened frequently,
that xplustabs() is *all* that will happen per keypress.  No refresh,
not redraw, nothing.  It's an optimization in the wrong corner: making
the shortest route still shorter.  Where optimization is needed is on
the longest routes.  Cutting function calls from these long routes is
welcome, even at the cost of making the shortest routes longer.

> Besides, it might become a bottleneck if the
> user is holding the Up or Down arrow.

Holding down <Up> while already at the top of the file?
No, that will never become a bottleneck.

> > 0025: Why?  This duplicates a chunk of code.  What does it gain us?
> 
> I was doing what you said here:
> 
> http://lists.gnu.org/archive/html/nano-devel/2017-01/msg00040.html
> 
> "O gott, another expansion...  Why not split update_line() into two
> functions, [...]

Okay.  I didn't think of having to duplicate half of the environment.  :|

> Now as for breaking on whitespace instead of the screen... that is a new
> feature, and I can split it off, but it will of course still be on top
> of this.

Sure.

> > (Also, it should not be called softwrapatblanks, because this shares
> > too many letters with softwrap.)
> 
> Okay, but I don't like wrapatblanks because it makes me think of hard
> wrapping.  Breaking on whitespace is something word processors do; maybe
> use a name related to that?

Let's call it simply 'atblanks'.  The option 'constantshow' doesn't say
what is constantly being shown either, nor does 'smooth' say what is
being done smoothly.  So 'atblanks' will be fine, since mostly the user
will put in the .nanorc file:

set softwrap
set atblanks

Benno

-- 
http://www.fastmail.com - IMAP accessible web-mail




reply via email to

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