Fri 07 Jul 2017 05:32:20 AM UTC, original submission:
This can be reproduced as follows. For indenting:
1. Start nano with the attached file linetest.txt:
./nano --ignore linetest.txt
2. Press Meta-} to indent the first line. The line should be indented by a tab, and the cursor should move forward a tab's worth of columns accordingly.
3. Press Down. The cursor will move to the second line, but its vertical position will change to the beginning of the line instead of staying where it was vertically on the first line.
(This is caused by nano's not updating placewewant when it adds indentation to the line.)
4. Press Meta-} to indent the second line.
5. Press Right, then press Left to ensure that placewewant is up to date for the next step: after the tab added to the second line.
6. Press Meta-{ to unindent the second line. The line should lose its tab, and the cursor should move back to the beginning of the line.
7. Press Up. The cursor will move to the first line, but its vertical position will change to after the tab on the first line instead of staying where it was vertically on the second line.
(This is caused by nano's not updating placewewant when it removes indentation from the line.)
The attached patch fixes both of these issues. The fix is modeled after similar code in do_comment(), since that function also does bulk updates of lines including the current line.
|