[Bug 4526] vi: fix end key "lock" which require Ctrl+c

bugzilla at busybox.net bugzilla at busybox.net
Thu Nov 24 22:38:22 UTC 2011


https://bugs.busybox.net/show_bug.cgi?id=4526

Tanguy Pruvot <tanguy.pruvot at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |

--- Comment #2 from Tanguy Pruvot <tanguy.pruvot at gmail.com> 2011-11-24 22:38:22 UTC ---
diff --git a/editors/vi.c b/editors/vi.c
index 71d6008..8a28212 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -3069,9 +3069,8 @@ static void do_cmd(int c)
        int cnt, i, j;
        int c1;

-//     c1 = c; // quiet the compiler
-//     cnt = yf = 0; // quiet the compiler
-//     p = q = save_dot = buf; // quiet the compiler
+       c1 = cnt = 0;
+       p = q = save_dot = NULL;
        memset(buf, '\0', sizeof(buf));

        show_status_line();
@@ -3317,12 +3316,19 @@ static void do_cmd(int c)
 #endif /* FEATURE_VI_YANKMARK */
        case '$':                       // $- goto end of line
        case KEYCODE_END:               // Cursor Key End
+               if (--cmdcnt > 0) {
+                       dot_next();
+                       do_cmd(c);
+               }
+               dot = end_line(dot);
+/*
                for (;;) {
                        dot = end_line(dot);
                        if (--cmdcnt > 0)
                                break;
                        dot_next();
                }
+*/
                break;
        case '%':                       // %- find matching char of pair () []
{}
                for (q = dot; q < end && *q != '\n'; q++) {

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list