nano

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

commit 4c476bc872a80bb180bf10c99d7e4295126b67f4
parent 9c2e270b3efa10e09355d58eb39255356a58101a
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Fri, 28 Oct 2016 11:37:03 +0200

scrolling: use a comparison that will work also in softwrap mode

This fixes https://savannah.gnu.org/bugs/?49467.

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

diff --git a/src/move.c b/src/move.c @@ -438,12 +438,10 @@ void do_up(bool scroll_only) openfile->current_x = actual_x(openfile->current->data, openfile->placewewant); - /* If scroll_only is FALSE and if we're on the first line of the - * edit window, scroll the edit window up one line if we're in - * smooth scrolling mode, or up half a page if we're not. If - * scroll_only is TRUE, scroll the edit window up one line - * unconditionally. */ - if (openfile->current_y == 0 || scroll_only) + /* When the cursor was on the first line of the edit window (or when just + * scrolling without moving the cursor), scroll the edit window up -- one + * line if we're in smooth scrolling mode, and half a page otherwise. */ + if (openfile->current->next == openfile->edittop || scroll_only) edit_scroll(UPWARD, (ISSET(SMOOTH_SCROLL) || scroll_only) ? 1 : editwinrows / 2 + 1);