summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-14 20:37:57 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-14 20:37:57 +0200
commit69fbc9e1dab176f345719436cd89d854df0a2abd (patch)
treecb082b52c6e0e9a2bd99db92b83aa7269d90cdaa /src/getchar.c
parent38baa3e63427112d389de5e5942243414d9b1336 (diff)
patch 8.0.1108: cannot specify mappings for the terminal windowv8.0.1108
Problem: Cannot specify mappings for the terminal window. Solution: Add the :tmap command and associated code. (Jacob Askeland, closes #2073)
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 63d6542bfe..f22242769e 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -59,7 +59,7 @@ static int block_redo = FALSE;
* 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 @@ input_available(void)
* 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 @@ get_map_mode(char_u **cmdp, int forceit)
mode = SELECTMODE; /* :smap */
else if (modec == 'o')
mode = OP_PENDING; /* :omap */
+ else if (modec == 't')
+ mode = TERMINAL; /* :tmap */
else
{
--p;
@@ -4892,6 +4895,9 @@ makemap(
case LANGMAP:
c1 = 'l';
break;
+ case TERMINAL:
+ c1 = 't';
+ break;
default:
IEMSG(_("E228: makemap: Illegal mode"));
return FAIL;