From: Chris Allegretta Date: Fri, 27 Nov 2009 03:04:59 +0000 (+0000) Subject: 2009-11-26 Chris Allegretta X-Git-Tag: v2.2.0~6 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3b830ee19472f4c68586cb5fdd92ec6bb7c3b300;p=nano.git 2009-11-26 Chris Allegretta * 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 --- diff --git a/ChangeLog b/ChangeLog index a6b455be..863c1fbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2009-11-26 Chris Allegretta + * winio.c (edit_scroll): Adjust for long lines when scrolling. + 2009-11-26 Jordi Mallach * doc/man/*: Update all man pages to escape unescapred hyphens. diff --git a/src/move.c b/src/move.c index 14afc70f..578e3ef4 100644 --- a/src/move.c +++ b/src/move.c @@ -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 diff --git a/src/winio.c b/src/winio.c index c617fc8b..9f93ab1d 100644 --- a/src/winio.c +++ b/src/winio.c @@ -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();