]> granicus.if.org Git - vim/commitdiff
patch 9.0.1287: with the Kitty key protocl Esc with NumLock cannot be mapped v9.0.1287
authorBram Moolenaar <Bram@vim.org>
Mon, 6 Feb 2023 17:46:37 +0000 (17:46 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 6 Feb 2023 17:46:37 +0000 (17:46 +0000)
Problem:    With the Kitty key protocl Esc with NumLock cannot be mapped.
Solution:   Also use K_ESC when there is a modifier. (closes #11811)

src/term.c
src/version.c

index d7cece3830a27b7bf47eaf6509cd80c8c104efa3..c90efe5302e5efc7d660639a7692f67f9bdb99e3 100644 (file)
@@ -5349,6 +5349,11 @@ handle_key_with_modifier(
     if ((modifiers & MOD_MASK_SHIFT) && key >= 'a' && key <= 'z')
        key += 'A' - 'a';
 
+    // Putting Esc in the buffer creates ambiguity, it can be the start of an
+    // escape sequence.  Use K_ESC to avoid that.
+    if (key == ESC)
+       key = K_ESC;
+
     return put_key_modifiers_in_typebuf(key, modifiers,
                                        csi_len, offset, buf, bufsize, buflen);
 }
index 439698b32c5db1fb81fba1f5df7b19d66002e47f..9d5cb0fbaefc5ec2b96416ff3e08268c245a9b99 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1287,
 /**/
     1286,
 /**/