bugGNU nano - Bugs: bug #49106, when the cursor is close to the...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #49106: when the cursor is close to the right edge, it is sometimes placed one-off

Submitter:  Benno Schulenberg <bens>
Submitted:  Fri 16 Sep 2016 06:03:21 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sat 28 Nov 2020 03:23:31 PM UTC, comment #4: 

The workaround was removed today, in commit 00ac41f6.  It can only be reproduced when using 'stty cols' and setting the terminal's number of columns to a smaller number than it actually has.  The user should not do this.

(I did not change the wrefresh() back to a wnoutrefresh(), as I'm not sure that there is nothing that depends on bottombars() effectively including a call of doupdate().  But also because I think I like it that the help lines are updated "asynchronously" from the title bar and the edit window.)

Benno Schulenberg <bens>
Group administrator
Thu 01 Dec 2016 07:40:16 PM UTC, comment #3: 

The commit that fixed this bug... triggered bug #49742.

(I botched the reproduction recipe in comment #1, though -- it should be: 'stty cols 43 && LANGUAGE=en src/nano --ignore +75,88 doc/faq.html'.  This misplaces the cursor when using versions before 2.7.1 -- well, as long as it lands on the "Funny you should ask" line, because it is an interplay between the bottom right corner of the screen having a character printed on it /and/ the line-with-the-cursor having a length that is just two or three characters shorter than the screen width.)

Benno Schulenberg <bens>
Group administrator
Wed 12 Oct 2016 12:00:49 PM UTC, comment #2: 

Fixed in git, 0a18d89.

Benno Schulenberg <bens>
Group administrator
Wed 12 Oct 2016 11:38:54 AM UTC, comment #1: 

The bug is not limited to softwrapping, and it does not occur on a Linux console.  So the bug is probably related to bug #48852, and thus is most likely a VTE bug or an artifact of an ncurses optimization going wrong.

When your VTE-based terminal is 46 columns wide, a simple 'LANGUAGE=en src/nano --ignore +77,88' is enough to show the bug.  The trigger is that the last item on the two help lines just exactly fits on the screen, meaning that writing it will move the cursor out of the subwindow, which then causes VTE/ncurses to misplace the cursor upon the next cursor move.

Benno Schulenberg <bens>
Group administrator
Fri 16 Sep 2016 06:03:21 PM UTC, original submission:  

To reproduce, run 'stty rows 20 && stty cols 120 && src/nano --ignore --nowrap --soft +193,888 doc/faq.html' and notice that the cursor is placed one position beyond the end of the line.

Now repeat the following key sequence several times: <Left> <Left> <Right>, and notice that each character seems to be "transported" a position to the right.  This happens as long as the statusbar message about the number of lines that were read is present.  As soon as it disappears, behavior reverts to normal and characters are (when the cursor passes over them) put back to their actual place.

So, if you add --quick to the command-line options, on startup the cursor will still be placed wrong, but the first <Left> will move the cursor two positions left into its correct place.

This bug exists since nano-2.4.3.  In 2.4.2 and before, the cursor is still placed wrongly at startup but the first <Left> will adjust that, even without --quick.

Benno Schulenberg <bens>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-10-31 bens Open/ClosedOpen Closed
    2016-10-12 bens StatusNone Fixed
        Assigned toNone bens
    2016-10-12 bens Summarywith softwrap, the cursor is sometimes placed one-off when the cursor is close to the right edge, it is sometimes placed one-off

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code