diff --git a/src/move.c b/src/move.c
index ebafa82b981eca76326702d48abf051cb9df6145..de3b533fbbd80ec4b60c5244292ffb3a88c054bb 100644
--- 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. */