nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 384332d08c73c2268f610393f1fbff82ba518b81
parent 6b1ad96f345f528bc0cd44b014690632d1ebc4dc
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Sun, 26 Mar 2017 18:50:55 -0500

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>

Diffstat:
Msrc/move.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/move.c b/src/move.c @@ -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;