Re: [PATCH] Added 'fullscrolling' option.

Benno Schulenberg <[email protected]> Sun, 4 Jan 2026 11:31:36 +0100
Newsgroups gmane.editors.nano.devel
Message-ID <[email protected]>
Op 03-01-2026 om 14:26 schreef xylia allegretta:
> This option makes the entire screen scroll horizontally instead of
> only the current line. The main reason for doing this is that it can
> be somewhat frustrating to look at very wide tables with the way that
> horizontal scrolling works normally. You either have to only look at
> the current part of one line at a time, or you have to enable wrapping
> and have the table messily split in half. By giving the option to
> scroll the entire screen, the table can be viewed much more easily.

Thanks for the patch.  The idea is good, but... a quick test on
a 100-column terminal:

   src/nano --full +1 doc/faq.html

Type <End>.  Only the current line scrolls, not the rest.
Now type <Left>.  The rest of the screen scrolls.
Now type <Home>.  Only the current line scrolls back to the start.
Now type <Right>.  The rest of the screen scrolls back.

Another test:

   src/nano +7 doc/faq.html

Type <End> and then toggle Horizontal Scrolling on (M-|).  The
whole screen adjusts to the cursor position -- correct.
Now type <Up>.  Only the preceding line gets redrawn, not the
rest of the screen.
Type <Up> again.  The "The GNU nano editor FAQ" line gets shown,
but still not the rest of the lines.
Now type <Home> <End> and then twenty times <Down>.  See how the
cursor jumps around but the lines that it visits stay invisible.

In short: there are not enough checks for whether to redraw the
screen when --fullscrolling is in effect.

Also, I don't like the huge jump to the right when the cursor
comes close to the right edge of the screen: it is disorienting.


Twelve years ago there was another patch that implemented horizontal
scrolling.  These are its first and its last version:

   https://lists.gnu.org/archive/html/nano-devel/2014-05/msg00025.html
   https://lists.gnu.org/archive/html/nano-devel/2014-06/msg00152.html

The latter patch applies cleanly (with only offsets) to version 2.3.5.
Running 2.3.5 with that patch, I like its horizontal-scrolling behavior
much better: one character at a time as the cursor moves further to the
right.  (It has some scrolling problems too -- when inserting characters,
for example.  But in general, its smooth scrolling feels much nicer.)


> Signed-off-by: Xylia Allegretta

Allegretta...  You are related to Chris?

If you're going to provide an improved version of your patch, please
split it into three patches: one that adds just the code for the
horizontal scrolling (enabled by default, for testing), one that
adds the option, and one that adds the toggle.  In the beginning
just the first patch is needed.  Only when the scrolling works well,
it will be time for the other patches.  Also, please follow nano's
coding style: a space after keywords like 'if', the opening brace
on the same line as 'if' and 'else', spaces around operators, and
a blank line after variable declarations.


Benno
OpenPGP_signature.asc (application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEEFo5vQpe/16ea/USWUUu+Lrjhlh8FAmlaQYgFAwAAAAAACgkQUUu+Lrjhlh9n
eBAAh45zCK7MUQ0FLHHdOlZePrLgv7ZKBzwNh4mdL396W408DQ8Dch8/uuFlPZCpluHwgFcdTVib
sqGyIXD2oVW5cuk67cLREzOK9FJMrjRkmcFH6/lBJxIQm6jV4dNoiKc30GATVaWHKKAFDY/09XsN
UB1c4DqZblb/MGaCS6LMVdAHmQkyqoajX9urHQVmyg4SJhPCP4U1k8RtA/c0caQp1O/n+zMeekf+
XfZcauJyXTzZmoRjKvCLBQFAnypuD917MGQGviSVDYJHD9XWa9TQdtdeC8ABFW2yfo4F4PzR/Dr0
0ej4KutuKyXfxc4isqxpfSOqcqGcVda2Kz6+Uxycs9P980LhPVUG3iaFlFORARLyGtjsvXrw+7vb
cQG5m6+FrwvizfU0+5VUdm3KSTet9u7FO7WGaJ3vF1IywWQXIQtE8+BthyMXl08qb2c6EMZsL3o4
+tW9Uit0mmllSfCdJD6A4YpC9kJGaK5B+KCOFzbmzdFMOHray+eN8+RsswDzJQsfxtbfSLScuRNd
bqsWdrJFCbJ/KmMDfsegB02GgLqAMzo77PKNeSxVNjnoUdMc9CAqJxS82emNGwZKnDY2qvEyXypW
9pj/ia4HdokYtXRBTIU1E7sZG64ns7l0V0Pm4U7fcUdTWv78WuQeXYpzBOvUOzwnJNph2GcoMS1Q
j0o=
=fK8v
-----END PGP SIGNATURE-----