nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] Proposal: Change how nano navigates softwrapped lines


From: David Ramsey
Subject: [Nano-devel] Proposal: Change how nano navigates softwrapped lines
Date: Mon, 12 Dec 2016 19:44:38 -0600

I propose the following way to deal with how nano moves through a file
in softwrap mode, based on how other editors with softwrap behave, and
to handle some bugs with the current softwrap code that render nano
inconsistent or unusable (49100 is an example of the latter):

Changes should be made to the following functions: up and down, pageup
and pagedown, and scroll-up (M--) and scroll-down (M-+).  These should
be the only functions changed because they are the only ones that make
nano move vertically through a file in constant amounts, limited only
by the file's length.  All the other functions that make nano move
vertically through a file either vary considerably based on the file's
contents, or (like previous-paragraph and next-paragraph) only work on
hard-wrapped lines, and so are unaffected by softwrap mode.

The changes should be as follows:

1. Instead of moving through a softwrapped line in its entirety, which
may take up several lines on screen, up and down should move a single
virtual softwrapped line, which will always take up a single line on
screen.

2. Instead of moving through softwrapped lines in their entirety until
they've moved an entire page's worth of lines, pageup and pagedown
should move an entire page's worth of single softwrapped lines.

3. Instead of scrolling through a softwrapped line in its entirety,
which may take up several lines on screen, scroll-up and scroll-down
should move a single virtual softwrapped line, which will always take
up a single line on screen.

These changes will eliminate the need to always keep the softwrapped
line the cursor is on entirely onscreen, which should fix the
aforementioned inconsistencies, and will ensure that nano no longer
becomes unusable in the case of a softwrapped line that takes up more
than one screenful (bug 49100).  They will also make it easier to
navigate through overly long lines vertically, which should save time.

However, they will add one bit of complexity: the current code assumes
that the top line of the edit window is always entirely onscreen, and
these changes will introduce the possibility that, when the top line
of the edit window takes up more than one softwrapped line, scrolling
a single virtual softwrapped line will put the top line of the edit
window partially off the screen.  nano will need to be adapted for
this corner case.

Comments?  Does anyone else think this is a good idea?  Thanks in advance.



reply via email to

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