forked from aniani/vim
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)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user