From 8619c53964bbf5253b05e268506fa20556a36b15 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sun, 16 Sep 2007 16:53:20 +0000 Subject: [PATCH] in edit_scroll(), fix problem where the screen wouldn't be updated properly if you paged up with the first line of the file onscreen and the mark on git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_2_0_branch/nano@4170 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ src/winio.c | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a49e8250..596663ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -74,6 +74,10 @@ CVS code - built with --enable-ext-mouse only needs to handle releases, so keep dealing with both events. (DLR, suggested by Helmut Jarausch) + edit_scroll() + - Fix problem where the screen wouldn't be updated properly if + you paged up with the first line of the file onscreen and the + mark on. (DLR) - configure.ac: - Update copyright notice to account for modifications. (DLR) - COPYING: diff --git a/src/winio.c b/src/winio.c index 814beb14..1c73a3b5 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2915,12 +2915,10 @@ void edit_scroll(scroll_dir direction, ssize_t nlines) /* Don't bother scrolling zero lines or more than the number of * lines in the edit window minus one; in both cases, get out, and - * in the latter case, call edit_refresh() beforehand. */ - if (nlines == 0) - return; - - if (nlines >= editwinrows) { - edit_refresh(); + * call edit_refresh() beforehand if we need to. */ + if (nlines == 0 || nlines >= editwinrows) { + if (do_redraw || nlines >= editwinrows) + edit_refresh(); return; } -- 2.39.5