nano

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

commit 9cf980700c305db8f3040c8b0e157a0ea56d1752
parent 244a503ddc614edf7b4a7bf88edc6b26ebbb23a0
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Mon, 27 Mar 2017 19:39:10 +0200

moving: don't try to redraw lines that have gone outside the viewport

When scrolling backward, it is not just the bottom line of the screen
that doesn't need to be redrawn: also the line /before/ the top line
doesn't need a redraw.  Mutatis mutandis for scrolling forward.

This fixes https://savannah.gnu.org/bugs/?50657.

Diffstat:
Msrc/move.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/move.c b/src/move.c @@ -489,7 +489,7 @@ void do_up(bool scroll_only) 1 : editwinrows / 2 + 1); /* If the lines weren't already redrawn, see if they need to be. */ - if (openfile->current_y > 0) { + if (openfile->current_y > 0 && openfile->current_y < editwinrows - 1) { /* Redraw the prior line if it's not actually the same line as the * current one (which it might be in softwrap mode, if we moved just * one chunk) and the line was horizontally scrolled. */ @@ -545,7 +545,7 @@ void do_down(bool scroll_only) 1 : editwinrows / 2 + 1); /* If the lines weren't already redrawn, see if they need to be. */ - if (openfile->current_y < editwinrows - 1) { + if (openfile->current_y > 0 && openfile->current_y < editwinrows - 1) { /* Redraw the prior line if it's not actually the same line as the * current one (which it might be in softwrap mode, if we moved just * one chunk) and the line was horizontally scrolled. */