changeset 26727:077277ee1626 v8.2.3892

patch 8.2.3892: when modifyOtherKeys is used CTRL-C is not recognized Commit: https://github.com/vim/vim/commit/35cfd793aad7c4bfba4a9bedf5c435c44e4293d0 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 25 15:13:18 2021 +0000 patch 8.2.3892: when modifyOtherKeys is used CTRL-C is not recognized Problem: When modifyOtherKeys is used CTRL-C is not recognized. Solution: Check for uppercase C as well, fix minimum length.
author Bram Moolenaar <Bram@vim.org>
date Sat, 25 Dec 2021 16:15:02 +0100
parents 4303d746ebe6
children 71ae885c1426
files src/ui.c src/version.c
diffstat 2 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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)))
+						       "\033[99;5u", 7) == 0)
+			|| (len >= 7 && STRNCMP(inbuf + inbufcount,
+						       "\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;
 	}
     }
--- a/src/version.c
+++ b/src/version.c
@@ -750,6 +750,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3892,
+/**/
     3891,
 /**/
     3890,