summaryrefslogtreecommitdiff
blob: f5d533633224aac351accbf15682a8033329d683 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
fix from upstream

diff -ur nano-1.3.12/src/move.c nano-1.3.12-fixed/src/move.c
--- nano-1.3.12/src/move.c	2006-05-21 22:08:49.000000000 -0400
+++ nano-1.3.12-fixed/src/move.c	2006-07-06 17:01:03.000000000 -0400
@@ -521,6 +521,16 @@
 
     /* Scroll the edit window up one line. */
     edit_scroll(UP, 1);
+
+    /* If we're not on the first line of the edit window, update the
+     * line we were on before and the line we're on now.  The former
+     * needs to be redrawn if we're not on the first page, and the
+     * latter needs to be drawn unconditionally. */
+    if (openfile->current_y > 0) {
+	if (need_vertical_update(0))
+	    update_line(openfile->current->next, 0);
+	update_line(openfile->current, openfile->current_x);
+    }
 }
 #endif /* !NANO_TINY */
 
@@ -574,6 +584,16 @@
 
     /* Scroll the edit window down one line. */
     edit_scroll(DOWN, 1);
+
+    /* If we're not on the last line of the edit window, update the line
+     * we were on before and the line we're on now.  The former needs to
+     * be redrawn if we're not on the first page, and the latter needs
+     * to be drawn unconditionally. */
+    if (openfile->current_y < editwinrows - 1) {
+	if (need_vertical_update(0))
+	    update_line(openfile->current->prev, 0);
+	update_line(openfile->current, openfile->current_x);
+    }
 }
 #endif /* !NANO_TINY */