commit 0ebfd54e17b86d1f9e6c81f6ad8fb4fb3996820f
parent 8f1cd50f1ed6d47a3c2d3c94b484d26a35b82929
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 13 May 2019 10:16:29 +0200
softwrap: use smooth scrolling when softwrapping is toggled on
If the cursor is near the bottom row when softwrap gets switched on, the
screen should scroll just the amount needed to keep the cursor onscreen.
This fixes https://savannah.gnu.org/bugs/?56317.
Bug existed since softwrapping was introduced in version 2.1.11.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/nano.c b/src/nano.c
@@ -1360,7 +1360,9 @@ void do_toggle(int flag)
signal_init();
break;
case SOFTWRAP:
- if (!ISSET(SOFTWRAP))
+ if (ISSET(SOFTWRAP))
+ edit_redraw(openfile->current, FLOWING);
+ else
openfile->firstcolumn = 0;
refresh_needed = TRUE;
break;