From ca538e6f08479842147e217c56cb7bced52dd8be Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 13 May 2018 19:24:58 +0200 Subject: [PATCH] scrolling: only do a scroll when the edit window has more than one row If the edit window consists of a single row, then the do_up() call has already brought the desired line into view -- which means that trying to scroll then (when already on the first line of the file) would fail. This fixes https://savannah.gnu.org/bugs/?53891. --- src/move.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/move.c b/src/move.c index 93cc4458..6a9adc6b 100644 --- a/src/move.c +++ b/src/move.c @@ -554,7 +554,8 @@ void do_scroll_up(void) if (openfile->current_y == editwinrows - 1) do_up(); - edit_scroll(BACKWARD); + if (editwinrows > 1) + edit_scroll(BACKWARD); } /* Scroll down one line or chunk without scrolling the cursor. */