]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.3892: when modifyOtherKeys is used CTRL-C is not recognized v8.2.3892
authorBram Moolenaar <Bram@vim.org>
Sat, 25 Dec 2021 15:13:18 +0000 (15:13 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 25 Dec 2021 15:13:18 +0000 (15:13 +0000)
Problem:    When modifyOtherKeys is used CTRL-C is not recognized.
Solution:   Check for uppercase C as well, fix minimum length.

src/ui.c
src/version.c

index db49cc87023f0a21cced583708f4249bef63741b..b37df4981933f63ca7e33e843510e8eca7e14d1f 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -1028,22 +1028,27 @@ fill_input_buf(int exit_on_error UNUSED)
                                     len + unconverted, INBUFLEN - inbufcount,
                                       rest == NULL ? &rest : NULL, &restlen);
        }
-       while (len-- > 0)
+       while (len > 0)
        {
            // If a CTRL-C was typed, remove it from the buffer and set
-           // got_int.  Also recognize CTRL-C with modifyOtherKeys set, in two
-           // forms.
+           // got_int.  Also recognize CTRL-C with modifyOtherKeys set, lower
+           // and upper case, in two forms.
            if (ctrl_c_interrupts && (inbuf[inbufcount] == 3
                        || (len >= 10 && STRNCMP(inbuf + inbufcount,
                                                   "\033[27;5;99~", 10) == 0)
+                       || (len >= 10 && STRNCMP(inbuf + inbufcount,
+                                                  "\033[27;5;67~", 10) == 0)
+                       || (len >= 7 && STRNCMP(inbuf + inbufcount,
+                                                      "\033[99;5u", 7) == 0)
                        || (len >= 7 && STRNCMP(inbuf + inbufcount,
-                                                      "\033[99;5u", 7) == 0)))
+                                                      "\033[67;5u", 7) == 0)))
            {
                // remove everything typed before the CTRL-C
-               mch_memmove(inbuf, inbuf + inbufcount, (size_t)(len + 1));
+               mch_memmove(inbuf, inbuf + inbufcount, (size_t)(len));
                inbufcount = 0;
                got_int = TRUE;
            }
+           --len;
            ++inbufcount;
        }
     }
index 6d23fa8fc0f18f7ea1dc075271ad7c2e1782ef92..bca7604dc1f8eb9fed400858fa16cc51cff8ea6c 100644 (file)
@@ -749,6 +749,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3892,
 /**/
     3891,
 /**/