diff src/misc2.c @ 31156:0ecb16d5f86f v9.0.0912

patch 9.0.0912: libvterm with modifyOtherKeys level 2 does not match xterm Commit: https://github.com/vim/vim/commit/c896adbcdee8b2296433a61c1f009aae9f68a594 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 19 19:02:40 2022 +0000 patch 9.0.0912: libvterm with modifyOtherKeys level 2 does not match xterm Problem: libvterm with modifyOtherKeys level 2 does not match xterm. Solution: Adjust key code escape sequences to be the same as what xterm sends in modifyOtherKeys level 2 mode. Check the value of no_reduce_keys before using it.
author Bram Moolenaar <Bram@vim.org>
date Sat, 19 Nov 2022 20:15:03 +0100
parents cc0c4141fb73
children 6fa4f94aca5a
line wrap: on
line diff
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1516,7 +1516,8 @@ find_special_key(
  * CTRL-2 is CTRL-@
  * CTRL-6 is CTRL-^
  * CTRL-- is CTRL-_
- * Also, <C-H> and <C-h> mean the same thing, always use "H".
+ * Also, unless no_reduce_keys is set then <C-H> and <C-h> mean the same thing,
+ * use "H".
  * Returns the possibly adjusted key.
  */
     int
@@ -1525,7 +1526,12 @@ may_adjust_key_for_ctrl(int modifiers, i
     if (modifiers & MOD_MASK_CTRL)
     {
 	if (ASCII_ISALPHA(key))
-	    return TOUPPER_ASC(key);
+	{
+#ifdef FEAT_TERMINAL
+	    check_no_reduce_keys();  // may update the no_reduce_keys flag
+#endif
+	    return no_reduce_keys == 0 ? TOUPPER_ASC(key) : key;
+	}
 	if (key == '2')
 	    return '@';
 	if (key == '6')