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.
master
Benno Schulenberg 2018-05-13 19:24:58 +02:00
parent 4b26308b6a
commit ca538e6f08
1 changed files with 2 additions and 1 deletions

View File

@ -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. */