display: catch all cases where the cursor can be pushed offscreen
Discarding (in commit 6f9bb53b) the cap on the number of chunks to move backwards had as an unforeseen side effect that the screen can fail to scroll when the cursor is somehow pushed offscreen. Fix this by setting the target row (for smooth scrolling) always to the bottom row of the edit window when nano notices that the cursor has gone offscreen. This fixes https://savannah.gnu.org/bugs/?51676. Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
Этот коммит содержится в:
родитель
f2317cc64e
Коммит
06ffcfaf40
@ -290,9 +290,6 @@ void do_uncut_text(void)
|
||||
/* Mark the file as modified. */
|
||||
set_modified();
|
||||
|
||||
/* Set the target row for the cursor in case it got pushed offscreen. */
|
||||
openfile->current_y = editwinrows - 1;
|
||||
|
||||
refresh_needed = TRUE;
|
||||
|
||||
#ifndef DISABLE_COLOR
|
||||
|
@ -1185,9 +1185,6 @@ void do_insertfile(void)
|
||||
openfile->current_x != was_current_x)
|
||||
set_modified();
|
||||
|
||||
/* Set the target row for the cursor when pushed offscreen. */
|
||||
openfile->current_y = editwinrows - 1;
|
||||
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
|
||||
|
@ -3216,6 +3216,7 @@ void edit_refresh(void)
|
||||
fprintf(stderr, "edit-refresh: line = %ld, edittop = %ld and editwinrows = %d\n",
|
||||
(long)openfile->current->lineno, (long)openfile->edittop->lineno, editwinrows);
|
||||
#endif
|
||||
openfile->current_y = editwinrows - 1;
|
||||
adjust_viewport((focusing || !ISSET(SMOOTH_SCROLL)) ? CENTERING : STATIONARY);
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user