]> git.wh0rd.org Git - nano.git/commitdiff
DLR's latest smooth scroll fix, case where there's not a full half page up from the...
authorChris Allegretta <chrisa@asty.org>
Tue, 2 Oct 2001 00:38:56 +0000 (00:38 +0000)
committerChris Allegretta <chrisa@asty.org>
Tue, 2 Oct 2001 00:38:56 +0000 (00:38 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@806 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
move.c

index ede5427b239b9010d498f9f87d35e6407d666402..2c86c0b5157320da43d874786621b06147ece8d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,7 +17,7 @@ CVS code -
        - Mac file writing supported too.  Flag -M, --mac.  Toggle 
          Meta-O (MacOS? OS-X? =-)
        - New smooth scroll code by Ken Tyler.  New flag -S, --smooth,
-         changes to page_up() and page_down(). Fixes to paging by
+         changes to page_up() and page_down().  Many fixes to paging by
          David Lawrence Ramsey.
        - Bracket (brace, parens, etc) matching code by Ken Tyler.  
          New functions do_find_bracket(), changes to findnextstr(),
diff --git a/move.c b/move.c
index 17d9684f88b3814d5e9de3e1a4a3834ae6454f68..75c40995bfcbbae21e1cdaff50c10690a6da6fad 100644 (file)
--- a/move.c
+++ b/move.c
@@ -143,7 +143,15 @@ void page_up(void)
     if (edittop != fileage) {
        if (!ISSET(SMOOTHSCROLL)) {
            edit_update(edittop, CENTER);
-           center_cursor();
+           /* Now that we've updated the edit window, edittop might be
+              at the top of the file; if so, just move the cursor up one
+              line and don't center it. */
+           if (edittop != fileage)
+               center_cursor();
+           else {
+               current = current->prev;
+               reset_cursor();
+           }
        } else {
            edit_update(edittop->prev, NONE);
        }