nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 6c81f609146f5f5801f88cdd4146570c7f0ca9eb
parent aa844ada4e596dfb61ed2da926ef87ee2376f21d
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 10 Jun 2024 07:51:44 +0200

moving: use edit_scroll() only when scrolling one row is enough

When softwrapping with a tabsize larger than the width of the viewport,
scrolling one row when the cursor goes offscreen might not be enough,
so in that case use edit_redraw() instead.

This fixes https://savannah.gnu.org/bugs/?65860.

Bug existed since version 2.9.6, commit 0d9080a2.

Diffstat:
Msrc/move.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/move.c b/src/move.c @@ -567,7 +567,8 @@ void do_up(void) set_proper_index_and_pww(&leftedge, target_column, FALSE); - if (openfile->cursor_row == 0 && !ISSET(JUMPY_SCROLLING)) + if (openfile->cursor_row == 0 && !ISSET(JUMPY_SCROLLING) && + (tabsize < editwincols || !ISSET(SOFTWRAP))) edit_scroll(BACKWARD); else edit_redraw(was_current, FLOWING); @@ -590,7 +591,8 @@ void do_down(void) set_proper_index_and_pww(&leftedge, target_column, TRUE); - if (openfile->cursor_row == editwinrows - 1 && !ISSET(JUMPY_SCROLLING)) + if (openfile->cursor_row == editwinrows - 1 && !ISSET(JUMPY_SCROLLING) && + (tabsize < editwincols || !ISSET(SOFTWRAP))) edit_scroll(FORWARD); else edit_redraw(was_current, FLOWING);