nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] Port of variable-width chunks (version 2)


From: David Ramsey
Subject: Re: [Nano-devel] Port of variable-width chunks (version 2)
Date: Tue, 27 Jun 2017 11:17:48 -0500

On Tue, Jun 27, 2017 at 6:56 AM, Benno Schulenberg <address@hidden>
wrote:
> Okay.  There is one problem.  To reproduce (with atblanks unset):
>
>     stty cols 50 && src/nano --soft +76,418 doc/faq.html
>
> Notice how the cursor is somewhere in the last chunk of a line, and
> that the line ends at the very edge of the screen (which is strange,
> because: where is the newline?).
>
> Now press <End>.  Nothing happens.  Weird!  Now press <Left>.  The
> cursor appears at the end of the line.  Ah!  The <End> /did/ move the
> cursor to the end of the line, but it couldn't be placed there because
> the end of line is beyond the edge of the terminal.
>
> The chunk routines somehow don't count the terminating (but absent)
> newline character as part of the line.

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.  See
below.

> I've pushed your mildly tweaked patches to this branch:
>
>     http://git.savannah.gnu.org/cgit/nano.git/log/?h=varisoft
>
> If you make a fix, it will be best do it on top of that branch.

Thank you.  The attached patch on top of that branch fixes the problem.

However, there is another problem that I haven't figured out, which can
be reproduced as follows.

1. Start with the varisoft branch of nano, with the above patch applied.

2. Copy the attached file nanorc.txt to your .nanorc.

3. With the attached file 50colbug.txt, run:

./nano --ignore --softwrap 50colbug.txt

4. Press End.  The cursor is placed where you'd expect: the next-to-last
column of the screen row.

5. Now run:

./nano 50colbug.txt

so that the nanorc is loaded.

6. Press End.  The cursor is now placed one column past where you'd
expect: the last column of the screen row, although the cursor position
is correct.  Pressing Ctrl-L places the cursor properly.

Running step 5, but toggling --constupdate mode off via Meta-C before
running step 6 will fix the problem.  Also, running step 5, but toggling
--nohelp mode off via Meta-X before running step 6 will fix the problem.
I'm guessing that there's a screen update missing somewhere, or there
may be something wrong with cursor placement with both of those options
set.

Attachment: nanorc.txt
Description: Text document


reply via email to

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