nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] minor bug in updating output


From: David Lawrence Ramsey
Subject: Re: [Nano-devel] minor bug in updating output
Date: Tue, 13 Sep 2005 01:19:48 -0400
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050716)

Alexey Toptygin wrote:

> On Mon, 12 Sep 2005, Mike Frysinger wrote:
>
>> - load up nano with a blank file
>> - spam a huge line of 'f' characters (wider than the current console)
>> - hit down arrow
>> - hit enter
>> - hit back space twice
>>
>> notice the cursor looks like it jumped right into the middle of the
>> huge line of text ... it should be at the end however ...
>>
>> - type a letter and notice that the output is updated properly ...
>> the letter appears at the end of the line as it should
>
> It seems to be between 1.3.2 and 1.3.3.

Fixed in CVS.  The problem was caused by my attempt, during my display
optimizations between 1.3.2 and 1.3.3, to only update once when doing a
backspace (by only updating vertically and not updating horizontally,
since the latter didn't seem to be necessary when the former was done)
instead of twice.  However, it appears that horizontal updates are
sometimes needed after all, so I've removed the erroneous attempt.  The
attached patch will add the same fix to 1.3.8.

diff -ur nano-1.3.8/src/global.c nano-1.3.8-fixed/src/global.c
--- nano-1.3.8/src/global.c     2005-06-28 02:25:34.000000000 -0400
+++ nano-1.3.8-fixed/src/global.c       2005-09-13 01:06:26.000000000 -0400
@@ -528,11 +528,11 @@
 
     sc_init_one(&main_list, NANO_FORWARD_KEY, N_("Forward"),
        IFHELP(nano_forward_msg, NANO_NO_KEY), NANO_NO_KEY,
-       NANO_NO_KEY, VIEW, do_right_void);
+       NANO_NO_KEY, VIEW, do_right);
 
     sc_init_one(&main_list, NANO_BACK_KEY, N_("Back"),
        IFHELP(nano_back_msg, NANO_NO_KEY), NANO_NO_KEY,
-       NANO_NO_KEY, VIEW, do_left_void);
+       NANO_NO_KEY, VIEW, do_left);
 
     sc_init_one(&main_list, NANO_HOME_KEY, N_("Home"),
        IFHELP(nano_home_msg, NANO_NO_KEY), NANO_NO_KEY,
diff -ur nano-1.3.8/src/move.c nano-1.3.8-fixed/src/move.c
--- nano-1.3.8/src/move.c       2005-06-28 14:57:28.000000000 -0400
+++ nano-1.3.8-fixed/src/move.c 2005-09-13 01:07:22.000000000 -0400
@@ -248,7 +248,7 @@
     update_line(current, current_x);
 }
 
-void do_left(bool allow_update)
+void do_left(void)
 {
     size_t pww_save = placewewant;
     if (current_x > 0)
@@ -259,16 +259,11 @@
     }
     placewewant = xplustabs();
     check_statusblank();
-    if (allow_update && need_horizontal_update(pww_save))
+    if (need_horizontal_update(pww_save))
        update_line(current, current_x);
 }
 
-void do_left_void(void)
-{
-    do_left(TRUE);
-}
-
-void do_right(bool allow_update)
+void do_right(void)
 {
     size_t pww_save = placewewant;
     assert(current_x <= strlen(current->data));
@@ -281,11 +276,6 @@
     }
     placewewant = xplustabs();
     check_statusblank();
-    if (allow_update && need_horizontal_update(pww_save))
+    if (need_horizontal_update(pww_save))
        update_line(current, current_x);
 }
-
-void do_right_void(void)
-{
-    do_right(TRUE);
-}
diff -ur nano-1.3.8/src/nano.c nano-1.3.8-fixed/src/nano.c
--- nano-1.3.8/src/nano.c       2005-06-29 13:10:58.000000000 -0400
+++ nano-1.3.8-fixed/src/nano.c 2005-09-13 01:10:11.000000000 -0400
@@ -1304,7 +1304,7 @@
 void do_backspace(void)
 {
     if (current != fileage || current_x > 0) {
-       do_left(FALSE);
+       do_left();
        do_delete();
     }
 }
@@ -4093,7 +4093,7 @@
            mark_beginx += char_buf_len;
 #endif
 
-       do_right(FALSE);
+       do_right();
 
 #ifndef DISABLE_WRAPPING
        /* If we're wrapping text, we need to call edit_refresh(). */
diff -ur nano-1.3.8/src/proto.h nano-1.3.8-fixed/src/proto.h
--- nano-1.3.8/src/proto.h      2005-06-29 23:55:55.000000000 -0400
+++ nano-1.3.8-fixed/src/proto.h        2005-09-13 01:07:40.000000000 -0400
@@ -353,10 +353,8 @@
 void do_page_down(void);
 void do_up(void);
 void do_down(void);
-void do_left(bool allow_update);
-void do_left_void(void);
-void do_right(bool allow_update);
-void do_right_void(void);
+void do_left(void);
+void do_right(void);
 
 /* Public functions in nano.c. */
 void print_view_warning(void);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]