nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] a newline getting pushed offscreen


From: Benno Schulenberg
Subject: [Nano-devel] a newline getting pushed offscreen
Date: Tue, 27 Jun 2017 21:06:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1


Op 27-06-17 om 18:17 schreef David Ramsey:
Argh.  The problem isn't limited to a 50-column screen, either.  On an
80x24 screen, it also shows up when pressing End after running:

    nano --ignore --soft +109,79 doc/faq.html

I know what's causing this, though.  The newline character is at the
edge of the screen in cases like these, so it gets pushed off beyond the
edge because the break occurs one column too late.  I first saw this
problem when softwrapping with atblanks set; it's why that mode breaks
lines one column before the edge of the screen instead of at the edge of
the screen.  The apparent fix is to make *all* softwrapping, regardless
of atblanks, break lines one column before the edge of the screen.

No, I don't like that solution: it wastes a column.  If you do want to
break early, then you'll have to use a continuation character a la Emacs,
because otherwise the user will wonder why that last column is always empty.

However, there is another problem that I haven't figured out,

One thing at a time.  I am first wondering what to do about the first
problem.  It seems to me that the counting how many columns a line is,
counts one column too few: the column where the cursor is when it is
at the very end of the line, on the virtual newline -- that is: on the
terminating \0 byte.  That byte also needs a column.

Benno



reply via email to

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