From a7f488b51f4c38d0ccac06e80c9dc9295d046724 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sun, 17 Jul 2005 02:19:47 +0000 Subject: [PATCH] fix glitch in edit_scroll() where scrolling up to the top line of the file with fewer than nlines lines available to scroll would leave half the screen unupdated git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2880 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/winio.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/winio.c b/src/winio.c index 63689298..d8a24c2c 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3536,6 +3536,14 @@ void edit_scroll(updown direction, int nlines) wscrl(edit, (direction == UP) ? -nlines : nlines); scrollok(edit, FALSE); + /* If we scrolled up, we couldn't scroll up all nlines lines, and + * we're now at the top of the file, we need to treat the entire + * screen as the scrolled region, instead of just the top nlines + * lines. */ + if (direction == UP && i > 0 && openfile->edittop == + openfile->fileage) + nlines = editwinrows; + /* Add two to nlines, to account for the lines before and after the * scrolled region. */ nlines += 2; -- 2.39.5