patch 8.0.1108: cannot specify mappings for the terminal window
Problem: Cannot specify mappings for the terminal window.
Solution: Add the :tmap command and associated code. (Jacob Askeland,
closes #2073)
diff --git a/src/getchar.c b/src/getchar.c
index 63d6542..f222427 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -59,7 +59,7 @@
* Returns a value between 0 and 255, index in maphash.
* Put Normal/Visual mode mappings mostly separately from Insert/Cmdline mode.
*/
-#define MAP_HASH(mode, c1) (((mode) & (NORMAL + VISUAL + SELECTMODE + OP_PENDING)) ? (c1) : ((c1) ^ 0x80))
+#define MAP_HASH(mode, c1) (((mode) & (NORMAL + VISUAL + SELECTMODE + OP_PENDING + TERMINAL)) ? (c1) : ((c1) ^ 0x80))
/*
* Each mapping is put in one of the 256 hash lists, to speed up finding it.
@@ -3188,6 +3188,7 @@
* for :xmap mode is VISUAL
* for :smap mode is SELECTMODE
* for :omap mode is OP_PENDING
+ * for :tmap mode is TERMINAL
*
* for :abbr mode is INSERT + CMDLINE
* for :iabbr mode is INSERT
@@ -3832,6 +3833,8 @@
mode = SELECTMODE; /* :smap */
else if (modec == 'o')
mode = OP_PENDING; /* :omap */
+ else if (modec == 't')
+ mode = TERMINAL; /* :tmap */
else
{
--p;
@@ -4892,6 +4895,9 @@
case LANGMAP:
c1 = 'l';
break;
+ case TERMINAL:
+ c1 = 't';
+ break;
default:
IEMSG(_("E228: makemap: Illegal mode"));
return FAIL;