Sun 26 Mar 2017 11:54:28 PM UTC, original submission:
With current git, in an 80x24 terminal, with the attached file paragraph.txt, run:
nano +12 --ignore --softwrap paragraph.txt
Press PageDown, so that the screen scrolls (it shouldn't do this, since it's at the bottom of the file, but that's a separate bug), and then press PageUp. The cursor will be placed back at the top of the file, but the top line won't change until you press PageUp again (Ctrl-L won't work).
This is caused by PageUp and PageDown's not handling the case where softwrap is on, smooth scrolling is off, and the line at the top of the screen is partially scrolled offscreen.
Specifically, nano sets current to edittop and placewewant to zero to put the cursor at the beginning of the top line of the file. However, if the top line is partially offscreen, this is incorrect, since the line begins at firstcolumn, not zero. Furthermore, nano changes placewewant here, but doesn't change target_column to match. Since target_column is set based on the value of placewewant whether we're in softwrap mode or not, this means the line is drawn incorrectly.
|