nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit dbeb503316b0af230679e29053696e6f9aafd65e
parent 4c221675a84554716e7f92c192008f21983374d4
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Sun, 17 Jul 2005 15:42:21 +0000

fix edit_scroll() redundancy


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

Diffstat:
Msrc/winio.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -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. */