changeset 31910:69003e374f0d v9.0.1287

patch 9.0.1287: with the Kitty key protocl Esc with NumLock cannot be mapped Commit: https://github.com/vim/vim/commit/0261e3978e3064176f57008d4ce6de18cb166b69 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 6 17:46:37 2023 +0000 patch 9.0.1287: with the Kitty key protocl Esc with NumLock cannot be mapped Problem: With the Kitty key protocl Esc with NumLock cannot be mapped. Solution: Also use K_ESC when there is a modifier. (closes https://github.com/vim/vim/issues/11811)
author Bram Moolenaar <Bram@vim.org>
date Mon, 06 Feb 2023 19:00:03 +0100
parents 998a31937647
children 86cb87d9f7df
files src/term.c src/version.c
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/term.c
+++ b/src/term.c
@@ -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);
 }
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1287,
+/**/
     1286,
 /**/
     1285,