Commit 384332d0 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey Committed by Benno Schulenberg
Browse files

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: default avatarDavid Lawrence Ramsey <pooka109@gmail.com>
No related merge requests found
Showing with 4 additions and 2 deletions
+4 -2
......@@ -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;
......
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