fix edit_scroll() redundancy

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2884 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-07-17 15:42:21 +00:00
parent 4c221675a8
commit dbeb503316
1 changed files with 4 additions and 3 deletions

View File

@ -3544,9 +3544,10 @@ void edit_scroll(updown direction, int nlines)
openfile->fileage)
nlines = editwinrows;
/* Add two to nlines, to account for the lines before and after the
* scrolled region. */
nlines += 2;
/* 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;
/* If we scrolled up, we're on the line before the scrolled
* region. */