Commit 9cf98070 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
parent 244a503d
Showing with 2 additions and 2 deletions
+2 -2
...@@ -489,7 +489,7 @@ void do_up(bool scroll_only) ...@@ -489,7 +489,7 @@ void do_up(bool scroll_only)
1 : editwinrows / 2 + 1); 1 : editwinrows / 2 + 1);
/* If the lines weren't already redrawn, see if they need to be. */ /* 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 /* 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 * current one (which it might be in softwrap mode, if we moved just
* one chunk) and the line was horizontally scrolled. */ * one chunk) and the line was horizontally scrolled. */
...@@ -545,7 +545,7 @@ void do_down(bool scroll_only) ...@@ -545,7 +545,7 @@ void do_down(bool scroll_only)
1 : editwinrows / 2 + 1); 1 : editwinrows / 2 + 1);
/* If the lines weren't already redrawn, see if they need to be. */ /* 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 /* 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 * current one (which it might be in softwrap mode, if we moved just
* one chunk) and the line was horizontally scrolled. */ * one chunk) and the line was horizontally scrolled. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment