1
0
forked from aniani/vim

patch 8.1.1759: no mode char for terminal mapping from maparg()

Problem:    No mode char for terminal mapping from maparg().
Solution:   Check for TERMINAL mode. (closes #4735)
This commit is contained in:
Bram Moolenaar
2019-07-27 21:05:21 +02:00
parent d5c8234517
commit 14371ed697
3 changed files with 10 additions and 0 deletions

View File

@@ -4009,6 +4009,8 @@ map_mode_to_chars(int mode)
ga_append(&mapmode, 'n'); /* :nmap */
if (mode & OP_PENDING)
ga_append(&mapmode, 'o'); /* :omap */
if (mode & TERMINAL)
ga_append(&mapmode, 't'); /* :tmap */
if ((mode & (VISUAL + SELECTMODE)) == VISUAL + SELECTMODE)
ga_append(&mapmode, 'v'); /* :vmap */
else

View File

@@ -29,6 +29,12 @@ function Test_maparg()
\ 'nowait': 1, 'expr': 0, 'sid': sid, 'lnum': lnum + 1, 'rhs': 'bar',
\ 'buffer': 1},
\ maparg('foo', '', 0, 1))
let lnum = expand('<sflnum>')
tmap baz foo
call assert_equal({'silent': 0, 'noremap': 0, 'lhs': 'baz', 'mode': 't',
\ 'nowait': 0, 'expr': 0, 'sid': sid, 'lnum': lnum + 1, 'rhs': 'foo',
\ 'buffer': 0},
\ maparg('baz', 't', 0, 1))
map abc x<char-114>x
call assert_equal("xrx", maparg('abc'))

View File

@@ -777,6 +777,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1759,
/**/
1758,
/**/