]> git.wh0rd.org Git - nano.git/commitdiff
2009-11-26 Chris Allegretta <chrisa@asty.org>
authorChris Allegretta <chrisa@asty.org>
Fri, 27 Nov 2009 03:04:59 +0000 (03:04 +0000)
committerChris Allegretta <chrisa@asty.org>
Fri, 27 Nov 2009 03:04:59 +0000 (03:04 +0000)
        * winio.c (edit_scroll): Adjust for long lines when scrolling.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4444 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/move.c
src/winio.c

index a6b455be27aa5f699b159e4e0aec251f64548d3f..863c1fbfbc8c56ca7820ec7dccbcf2549dc49a70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2009-11-26 Chris Allegretta <chrisa@asty.org>
+       * winio.c (edit_scroll): Adjust for long lines when scrolling.
+
 2009-11-26 Jordi Mallach <jordi@gnu.org>
        * doc/man/*: Update all man pages to escape unescapred hyphens.
 
index 14afc70f56d64b5a8793d6e1c2adba41c25f18b4..578e3ef41bc479bcef11248a1e7ef4684d916ea0 100644 (file)
@@ -133,7 +133,7 @@ void do_page_down(void)
        openfile->placewewant);
 
     /* Scroll the edit window down a page. */
-    edit_scroll(DOWN_DIR, maxrows - 2);
+    edit_scroll(DOWN_DIR, editwinrows - 2);
 }
 
 #ifndef DISABLE_JUSTIFY
index c617fc8bf000ecd41ff150f7f3aebc38d7b8d7eb..9f93ab1d975629e1411bec2c679d1ff1924874d6 100644 (file)
@@ -3038,6 +3038,9 @@ void edit_scroll(scroll_dir direction, ssize_t nlines)
                break;
            openfile->edittop = openfile->edittop->next;
        }
+       /* Don't over-scroll on long lines */
+       if (ISSET(SOFTWRAP))
+           i -= strlenpt(openfile->edittop->data) / COLS;
     }
 
     compute_maxrows();