commit 8d692a87dc61d8340ec65b7ab27eaa472f6caf55
parent 13176792f01cb734e3b27a99feef8b11c50af2c7
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Tue, 3 Jan 2017 15:26:05 +0100
softwrap: don't scroll half a page when just a few lines will do
This fixes https://savannah.gnu.org/bugs/?49824.
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/nano.c b/src/nano.c
@@ -1767,6 +1767,10 @@ int do_mouse(void)
((mouse_y - current_row) * editwincols) + mouse_x);
} else
openfile->current_x = actual_x(openfile->current->data, mouse_x);
+
+ openfile->current_y = current_row;
+ ensure_line_is_visible();
+ refresh_needed = TRUE;
} else
#endif /* NANO_TINY */
{
@@ -1796,7 +1800,8 @@ int do_mouse(void)
/* The cursor moved; clean the cutbuffer on the next cut. */
cutbuffer_reset();
- edit_redraw(current_save);
+ if (!ISSET(SOFTWRAP))
+ edit_redraw(current_save);
}
/* No more handling is needed. */