Commit 0d9080a2 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

scrolling: don't redraw entire edit window when cursor goes offscreen

When the cursor is on the top or bottom line of the edit window, and
an <Up> or <Down> pushes the cursor offscreen, then use edit_scroll()
to bring it back into view, instead of using edit_redraw(), because
the latter would redraw *every row* on the screen, which is a waste
of time.

This addresses https://savannah.gnu.org/bugs/?53562

.
Reported-by: default avatarDevin Hussey <husseydevin@gmail.com>
No related merge requests found
Showing with 8 additions and 2 deletions
+8 -2
......@@ -495,7 +495,10 @@ void do_up(void)
set_proper_index_and_pww(&leftedge, target_column, FALSE);
edit_redraw(was_current, FLOWING);
if (openfile->current_y == 0 && ISSET(SMOOTH_SCROLL))
edit_scroll(BACKWARD);
else
edit_redraw(was_current, FLOWING);
/* <Up> should not change placewewant, so restore it. */
openfile->placewewant = leftedge + target_column;
......@@ -515,7 +518,10 @@ void do_down(void)
set_proper_index_and_pww(&leftedge, target_column, TRUE);
edit_redraw(was_current, FLOWING);
if (openfile->current_y == editwinrows - 1 && ISSET(SMOOTH_SCROLL))
edit_scroll(FORWARD);
else
edit_redraw(was_current, FLOWING);
/* <Down> should not change placewewant, so restore it. */
openfile->placewewant = leftedge + target_column;
......
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