GNU nano - Bugs: bug #51776, with current git, nano can fail to...
You are not allowed to post comments on this tracker with your current authentication level.
bug #51776: with current git, nano can fail to scroll when tabs are wider than the screen
Submitter: | David Lawrence Ramsey <dolorous> | ||
Submitted: | Thu 17 Aug 2017 07:40:42 PM UTC | ||
Severity: | 4 - Important | Status: | Fixed |
Assigned to: | dolorous | Open/Closed: | Closed |
Jump to the original submission
Mon 21 Aug 2017 07:38:11 PM UTC, comment #13: |
Benno Schulenberg <bens> |
Sun 20 Aug 2017 08:56:39 PM UTC, comment #12: I would, but it's the logical extension of having the same done to the PageUp and PageDown code, which I recall used to use edit_scroll() too :) |
David Lawrence Ramsey <dolorous> |
Sun 20 Aug 2017 06:52:46 PM UTC, comment #11: I thought you would protest against the great waste of CPU cycles: repainting the entire edit window when a simple scroll of one row would do. :) |
Benno Schulenberg <bens> |
Sun 20 Aug 2017 03:25:03 PM UTC, comment #10: Looks good to me. |
David Lawrence Ramsey <dolorous> |
Sun 20 Aug 2017 08:53:21 AM UTC, comment #9: I don't think the softwrap case for <Left> and <Right> needs special casing -- edit_redraw() will handle it just fine. Similarly, the offscreen cases for <Up> and <Down> don't need an edit_scroll for the non-scroll_only case. So, including a correction to do_right() (prev instead of next), I suggest the attached version of the patch. |
Benno Schulenberg <bens> |
Sat 19 Aug 2017 08:00:08 PM UTC, comment #8: Attached new version that should fix it.
|
David Lawrence Ramsey <dolorous> |
Sat 19 Aug 2017 07:34:46 PM UTC, comment #7: The revamp breaks the placewewant mechanism. With the patch from the previous comment applied, run:
|
Benno Schulenberg <bens> |
Sat 19 Aug 2017 12:05:13 AM UTC, comment #6: Check that: edit_scroll() is also needed when we go offscreen during normal movement.
|
David Lawrence Ramsey <dolorous> |
Fri 18 Aug 2017 06:59:18 PM UTC, comment #5: If you apply the patch in #51778, and run:
|
David Lawrence Ramsey <dolorous> |
Fri 18 Aug 2017 06:32:29 PM UTC, comment #4: The patch in bug #51778 should fix the Left/Right navigation issues. I'm still concerned about the screen update problems, though; edit_scroll() isn't enough to get the cursor back on screen with such tabs, and cursor_is_below_screen() is expensive, as you've pointed out. (And the patch here didn't properly handle Right/End navigation when putting such tabs on one line, now that I think about it.) |
David Lawrence Ramsey <dolorous> |
Fri 18 Aug 2017 05:36:52 PM UTC, comment #3: Hm. I have emacs 25.1.1, and when doing 'emacs -nw NEWS' (with only "(setq-default tab-width 181)" in the .emacs file), each indented line of the NEWS file takes up five rows on the screen, just like in vim, and just like I expect it in nano. (In emacs it is much clearer what is happening, though, because of the continuation marks at the end of each row where a tab is softwrapped.)
|
Benno Schulenberg <bens> |
Thu 17 Aug 2017 07:46:47 PM UTC, comment #2: As for how to fix this problem in a way that won't require rewriting all the display code, there are two main options: vim and emacs. Since vim's vertical navigation of lines is rather different from nano's, I've followed emacs (specifically, version 24.5). If your .emacs contains the following:
|
David Lawrence Ramsey <dolorous> |
Thu 17 Aug 2017 07:41:18 PM UTC, comment #1: This is with git e09dbf1, by the way. |
David Lawrence Ramsey <dolorous> |
Thu 17 Aug 2017 07:40:42 PM UTC, original submission:
This can be reproduced as follows:
|
David Lawrence Ramsey <dolorous> |
Depends on the following items: None found
Items that depend on this one: None found
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 11 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2017-08-28 | bens | Open/Closed | Open | Closed | |
2017-08-21 | bens | Severity | 3 - Normal | 4 - Important | |
Status | None | Fixed | |||
Assigned to | None | dolorous | |||
Summary | with current git, nano can misdisplay lines containing tabs wider than the screen | with current git, nano can fail to scroll when tabs are wider than the screen | |||
2017-08-20 | bens | Attached File | - | Added even-tighter.patch, #41584 | |
2017-08-19 | dolorous | Attached File | - | Added 0001-display-revamp-how-screen-updates-are-done-in-the-mo.patch, #41581 | |
2017-08-19 | dolorous | Attached File | - | Added 0001-display-revamp-how-screen-updates-are-done-in-the-mo.patch, #41577 | |
2017-08-18 | dolorous | Attached File | - | Added long-tab2.txt, #41573 | |
2017-08-17 | dolorous | Attached File | - | Added 0001-softwrap-make-tabs-wider-than-the-screen-take-up-onl.patch, #41559 | |
2017-08-17 | dolorous | Attached File | - | Added long-tab.txt, #41558 |
Powered by Savane 3.13-f8d8.
Corresponding source code
Well, PageUp/PageDown just leave two rows of overlap. Redrawing all rows, or scrolling and redrawing all rows minus two, that doesn't make much of a difference. But when scrolling just one row...
So, normally I would have opted for the more economical version -- yours. But now, with all the difficulties, I have gone for the one that makes things the most simple, the most straightforward.
Pushed to master, 5e105287. Thanks for the original patch.