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.
master
Benno Schulenberg 2019-05-13 10:16:29 +02:00
parent 8f1cd50f1e
commit 0ebfd54e17
1 changed files with 3 additions and 1 deletions

View File

@ -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;