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: Devin Hussey <husseydevin@gmail.com>
Этот коммит содержится в:
родитель
1ae90e205a
Коммит
0d9080a22c
10
src/move.c
10
src/move.c
@ -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;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user