]> git.wh0rd.org Git - nano.git/commitdiff
- winio.c:edit_refresh() - Fix cursor being above as well as below the current screen...
authorChris Allegretta <chrisa@asty.org>
Sun, 26 Jan 2003 19:47:10 +0000 (19:47 +0000)
committerChris Allegretta <chrisa@asty.org>
Sun, 26 Jan 2003 19:47:10 +0000 (19:47 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1396 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
winio.c

index eeab326dbafee1d02240c00e8ff0eaf4555eef70..e60754c257472f075e485652caeef0747595592b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,9 @@ CVS Code -
   do_replace_loop()
        - Fix various bugs having to do with replace string length
          and positioning (David Benbennick).
+  edit_refresh()
+       - Fix cursor being above as well as below the current screen
+         (David Benbennick).
 - winio.c:
   bottombars()
        - Change strcpy of gettext() "Up" string to strncpy of max
diff --git a/winio.c b/winio.c
index cca2e33e8a1306358b38d9c37dc71638237e14c1..3ed476261580457a7c46e2ddcb6ba3559767763a 100644 (file)
--- a/winio.c
+++ b/winio.c
@@ -1093,7 +1093,8 @@ void edit_refresh(void)
     if (edittop == NULL)
        edittop = current;
 
-    if (current->lineno >= edittop->lineno + editwinrows)
+    if (current->lineno < edittop->lineno ||
+           current->lineno >= edittop->lineno + editwinrows)
        /* Note that edit_update() changes edittop so that
         * current->lineno = edittop->lineno + editwinrows / 2.  Thus
         * when it then calls edit_refresh(), there is no danger of