commit de0c5eb8996e8799c63d7be65df9568a9cf169bb
parent dbeb503316b0af230679e29053696e6f9aafd65e
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sun, 17 Jul 2005 22:51:44 +0000
better edit_scroll() redundancy fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2885 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -3546,8 +3546,9 @@ void edit_scroll(updown direction, int nlines)
/* Make nlines account for the lines before and after the scrolled
* region, if they're onsccreen. */
- nlines += (nlines <= editwinrows - 2) ? 2 :
- (nlines == editwinrows - 1) ? 1 : 0;
+ nlines += 2;
+ if (nlines > editwinrows)
+ nlines = editwinrows;
/* If we scrolled up, we're on the line before the scrolled
* region. */