Commit 8d692a87 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

softwrap: don't scroll half a page when just a few lines will do

This fixes https://savannah.gnu.org/bugs/?49824.
No related merge requests found
Showing with 6 additions and 1 deletion
+6 -1
...@@ -1767,6 +1767,10 @@ int do_mouse(void) ...@@ -1767,6 +1767,10 @@ int do_mouse(void)
((mouse_y - current_row) * editwincols) + mouse_x); ((mouse_y - current_row) * editwincols) + mouse_x);
} else } else
openfile->current_x = actual_x(openfile->current->data, mouse_x); openfile->current_x = actual_x(openfile->current->data, mouse_x);
openfile->current_y = current_row;
ensure_line_is_visible();
refresh_needed = TRUE;
} else } else
#endif /* NANO_TINY */ #endif /* NANO_TINY */
{ {
...@@ -1796,7 +1800,8 @@ int do_mouse(void) ...@@ -1796,7 +1800,8 @@ int do_mouse(void)
/* The cursor moved; clean the cutbuffer on the next cut. */ /* The cursor moved; clean the cutbuffer on the next cut. */
cutbuffer_reset(); cutbuffer_reset();
edit_redraw(current_save); if (!ISSET(SOFTWRAP))
edit_redraw(current_save);
} }
/* No more handling is needed. */ /* No more handling is needed. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment