From: David Lawrence Ramsey Date: Mon, 1 Aug 2005 21:53:54 +0000 (+0000) Subject: cosmetic fixes X-Git-Tag: v1.3.9~75 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=c25ed534ebe7c07a3a9dc0849c0a56a899a2d15c;p=nano.git cosmetic fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2971 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/winio.c b/src/winio.c index b45d9dc4..f8e40834 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3506,13 +3506,12 @@ void edit_scroll(scroll_dir direction, ssize_t nlines) } } - /* Limit nlines to a minimum of the number of lines we could scroll, - * and to a maximum of the number of lines in the edit window, minus - * one. Don't bother scrolling zero lines or the number of lines in - * the edit window; in both cases, get out, and in the latter case, - * call edit_refresh() beforehand. */ + /* Limit nlines to the number of lines we could scroll. */ nlines -= i; + /* 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; @@ -3543,6 +3542,7 @@ void edit_scroll(scroll_dir direction, ssize_t nlines) * before and after the scrolled region are visible in the edit * window, we need to draw them too. */ nlines += (nlines == 1) ? 1 : 2; + if (nlines > editwinrows) nlines = editwinrows;