eliminate still more redundant screen updates in edit_scroll()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2915 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
27865304d7
commit
945a91357a
18
src/winio.c
18
src/winio.c
|
@ -3519,7 +3519,9 @@ void edit_scroll(updown direction, int nlines)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Limit nlines to the number of lines in the edit window. */
|
/* 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. */
|
||||||
|
nlines -= i;
|
||||||
if (nlines > editwinrows)
|
if (nlines > editwinrows)
|
||||||
nlines = editwinrows;
|
nlines = editwinrows;
|
||||||
|
|
||||||
|
@ -3537,11 +3539,17 @@ void edit_scroll(updown direction, int nlines)
|
||||||
* window. */
|
* window. */
|
||||||
if (direction == UP && i > 0 && openfile->edittop ==
|
if (direction == UP && i > 0 && openfile->edittop ==
|
||||||
openfile->fileage)
|
openfile->fileage)
|
||||||
nlines = editwinrows - 2;
|
nlines = editwinrows;
|
||||||
|
|
||||||
/* If the lines before and after the scrolled region are visible in
|
/* If the scrolled region contains only one line, and the line
|
||||||
* the edit window, we need to draw them too. */
|
* before it is visible in the edit window, we need to draw it too.
|
||||||
nlines += 2;
|
* If the scrolled region contains more than one line, and the lines
|
||||||
|
* before and after the scrolled region are visible in the edit
|
||||||
|
* window, we need to draw them too. */
|
||||||
|
if (nlines == 1)
|
||||||
|
nlines++;
|
||||||
|
else
|
||||||
|
nlines += 2;
|
||||||
if (nlines > editwinrows)
|
if (nlines > editwinrows)
|
||||||
nlines = editwinrows;
|
nlines = editwinrows;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue