1
1

display: make PageUp/PageDown use the correct beginning of the viewport

When typing PageUp or PageDOwn in non-smooth-scrolling mode, the cursor
should be placed at the start of the top line of the edit window.  This
means that, when the line at edittop is partially scrolled offscreen,
the cursor should be placed at openfile->firstcolumn, not at zero.

This fixes https://savannah.gnu.org/bugs/?50645.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
Этот коммит содержится в:
David Lawrence Ramsey 2017-03-26 18:50:55 -05:00 коммит произвёл Benno Schulenberg
родитель 6b1ad96f34
Коммит 384332d08c

Просмотреть файл

@ -60,7 +60,8 @@ void do_page_up(void)
* beginning of the top line of the edit window, as Pico does. */
if (!ISSET(SMOOTH_SCROLL)) {
openfile->current = openfile->edittop;
openfile->placewewant = openfile->current_y = 0;
openfile->placewewant = target_column = openfile->firstcolumn;
openfile->current_y = 0;
}
mustmove = (editwinrows < 3) ? 1 : editwinrows - 2;
@ -99,7 +100,8 @@ void do_page_down(void)
* beginning of the top line of the edit window, as Pico does. */
if (!ISSET(SMOOTH_SCROLL)) {
openfile->current = openfile->edittop;
openfile->placewewant = openfile->current_y = 0;
openfile->placewewant = target_column = openfile->firstcolumn;
openfile->current_y = 0;
}
mustmove = (editwinrows < 3) ? 1 : editwinrows - 2;