diff src/term.c @ 18295:43e9523f6d84 v8.1.2142

patch 8.1.2142: some key mappings do not work with modifyOtherKeys Commit: https://github.com/vim/vim/commit/d1e2f3984ae0b4e22ba6977eedcf05285819eea9 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 12 18:22:50 2019 +0200 patch 8.1.2142: some key mappings do not work with modifyOtherKeys Problem: Some key mappings do not work with modifyOtherKeys. Solution: Remove the Shift modifier if it is already included in the key.
author Bram Moolenaar <Bram@vim.org>
date Sat, 12 Oct 2019 18:30:04 +0200
parents e8d1f3209dcd
children a9cf41bcb5d6
line wrap: on
line diff
--- a/src/term.c
+++ b/src/term.c
@@ -4847,8 +4847,17 @@ not_enough:
 		    else
 			key = arg[2];
 
+		    modifiers = decode_modifiers(arg[1]);
+
+		    // Some keys already have Shift included, pass them as
+		    // normal keys.
+		    if (modifiers == MOD_MASK_SHIFT
+			    && ((key >= '@' && key <= 'Z')
+				|| key == '^' || key == '_'
+				|| (key >= '{' && key <= '~')))
+			modifiers = 0;
+
 		    // insert modifiers with KS_MODIFIER
-		    modifiers = decode_modifiers(arg[1]);
 		    new_slen = modifiers2keycode(modifiers, &key, string);
 		    slen = csi_len;