diff --git a/ChangeLog b/ChangeLog
index 79910ba9af36fa6d239106be690e3edb5ea6f854..07c0efcfaaf354d34ec3542918a460ad512495e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -304,6 +304,9 @@ CVS code -
 	  well as single-line ones.  This avoids a segfault when trying
 	  to color e.g. "start="$" end="$"". (DLR, found by Trevor
 	  Caira)
+  edit_redraw()
+	- Fix problem where not all lines would be updated properly if
+	  we'd scrolled off the screen and the mark was on. (DLR)
   do_credits()
 	- Update the last copyright notice to include 2006. (DLR)
 - configure.ac:
diff --git a/src/winio.c b/src/winio.c
index 51b7033cedb93f8a2907e91e323e5f236666816e..b7246f1fe0f925932a10cff8a0ee3fde0ebea25c 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2807,7 +2807,7 @@ void edit_redraw(const filestruct *old_current, size_t old_pww)
 {
     bool do_redraw = need_vertical_update(0) ||
 	need_vertical_update(old_pww);
-    const filestruct *foo;
+    const filestruct *foo = NULL;
 
     /* If either old_current or current is offscreen, scroll the edit
      * window until it's onscreen and get out. */
@@ -2819,6 +2819,26 @@ void edit_redraw(const filestruct *old_current, size_t old_pww)
 	filestruct *old_edittop = openfile->edittop;
 	ssize_t nlines;
 
+#ifndef NANO_TINY
+	/* If the mark is on, update all the lines between old_current
+	 * and the old last line of the edit window. */
+	if (openfile->mark_set) {
+	    ssize_t old_last_lineno = (old_edittop->lineno +
+		editwinrows <= openfile->filebot->lineno) ?
+		old_edittop->lineno + editwinrows :
+		openfile->filebot->lineno;
+
+	    foo = old_current;
+
+	    while (foo->lineno != old_last_lineno) {
+		update_line(foo, 0);
+
+		foo = (foo->lineno > old_last_lineno) ? foo->prev :
+			foo->next;
+	    }
+	}
+#endif /* !NANO_TINY */
+
 	/* Put edittop in range of current, get the difference in lines
 	 * between the original edittop and the current edittop, and
 	 * then restore the original edittop. */
@@ -2844,6 +2864,19 @@ void edit_redraw(const filestruct *old_current, size_t old_pww)
 	else
 	    edit_scroll(DOWN, nlines);
 
+#ifndef NANO_TINY
+	/* If the mark is on, update all the lines between the old last
+	 * line of the edit window and current. */
+	if (openfile->mark_set) {
+	    while (foo != openfile->current) {
+		update_line(foo, 0);
+
+		foo = (foo->lineno > openfile->current->lineno) ?
+			foo->prev : foo->next;
+	    }
+	}
+#endif /* !NANO_TINY */
+
 	return;
     }