[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] long lines arent always updated when scrolling by one l
From: |
David Lawrence Ramsey |
Subject: |
Re: [Nano-devel] long lines arent always updated when scrolling by one line |
Date: |
Thu, 06 Jul 2006 17:06:58 -0400 |
User-agent: |
Thunderbird 1.5.0.4 (X11/20060516) |
Mike Frysinger wrote:
> open up a terminal (say 80x24) and run nano
>
> then hold down enter to create like 50 lines (enough to be twice your
> term height so scrolling works)
>
> go back up to like line 10 and create a line that is longer than the
> terminal (i just hold down 'f' until i get like 100 hundred of them)
>
> when you put your cursor at the end of this line, nano should scroll
> the beginning of it to the left so you get something like:
> $ffffffffffffffffffffffffff[cursor]
>
> now hit meta and the plus key to scroll down one line ... the long
> line does not get updated until you move the cursor back over it with
> the arrow keys ...
Fixed in CVS. The problem was that do_scroll_(up|down)() needed to
manually update the previous and current lines after scrolling, just as
do_(up|down)() did. The attached patch should fix this in 1.3.12.
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 */