diff src/terminal.c @ 18301:506bf60a30a0 v8.1.2145

patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled Commit: https://github.com/vim/vim/commit/459fd785e4a8d044147a3f83a5fca8748528aa84 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 13 16:43:39 2019 +0200 patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled Problem: Cannot map <C-H> when modifyOtherKeys is enabled. Solution: Add the <C-H> mapping twice, both with modifier and as 0x08. Use only the first one when modifyOtherKeys has been detected.
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Oct 2019 16:45:04 +0200
parents e8d1f3209dcd
children 527b7084c556
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -772,7 +772,8 @@ ex_terminal(exarg_T *eap)
 
 	    p = skiptowhite(cmd);
 	    *p = NUL;
-	    keys = replace_termcodes(ep + 1, &buf, TRUE, TRUE, TRUE);
+	    keys = replace_termcodes(ep + 1, &buf,
+		    REPTERM_FROM_PART | REPTERM_DO_LT | REPTERM_SPECIAL, NULL);
 	    opt.jo_set2 |= JO2_EOF_CHARS;
 	    opt.jo_eof_chars = vim_strsave(keys);
 	    vim_free(buf);
@@ -1372,7 +1373,12 @@ term_convert_key(term_T *term, int c, ch
     }
 
     // add modifiers for the typed key
-    mod |= mod_mask;
+    if (mod_mask & MOD_MASK_SHIFT)
+	mod |= VTERM_MOD_SHIFT;
+    if (mod_mask & MOD_MASK_CTRL)
+	mod |= VTERM_MOD_CTRL;
+    if (mod_mask & (MOD_MASK_ALT | MOD_MASK_META))
+	mod |= VTERM_MOD_ALT;
 
     /*
      * Convert special keys to vterm keys: