summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-01 19:22:12 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-01 19:22:12 +0200
commit2da0f0c445da3c9b35b2a0cd595d10e81ad2a6f9 (patch)
treede42f08bbd29bad7e82f85da46d4fa546e0304df /src
parent0afdcf8601792ee751984265b49fc2ca6f8ea858 (diff)
patch 8.2.0491: cannot recognize a <script> mapping using maparg()v8.2.0491
Problem: Cannot recognize a <script> mapping using maparg(). Solution: Add the "script" key. (closes #5873)
Diffstat (limited to 'src')
-rw-r--r--src/map.c2
-rw-r--r--src/testdir/test_maparg.vim8
-rw-r--r--src/version.c2
3 files changed, 8 insertions, 4 deletions
diff --git a/src/map.c b/src/map.c
index 948b32cc6c..9bc9abca3a 100644
--- a/src/map.c
+++ b/src/map.c
@@ -2200,6 +2200,8 @@ get_maparg(typval_T *argvars, typval_T *rettv, int exact)
dict_add_string(dict, "lhs", lhs);
dict_add_string(dict, "rhs", mp->m_orig_str);
dict_add_number(dict, "noremap", mp->m_noremap ? 1L : 0L);
+ dict_add_number(dict, "script", mp->m_noremap == REMAP_SCRIPT
+ ? 1L : 0L);
dict_add_number(dict, "expr", mp->m_expr ? 1L : 0L);
dict_add_number(dict, "silent", mp->m_silent ? 1L : 0L);
dict_add_number(dict, "sid", (long)mp->m_script_ctx.sc_sid);
diff --git a/src/testdir/test_maparg.vim b/src/testdir/test_maparg.vim
index d6b61019bb..cc72e7e8e6 100644
--- a/src/testdir/test_maparg.vim
+++ b/src/testdir/test_maparg.vim
@@ -16,23 +16,23 @@ function Test_maparg()
map foo<C-V> is<F4>foo
vnoremap <script> <buffer> <expr> <silent> bar isbar
call assert_equal("is<F4>foo", maparg('foo<C-V>'))
- call assert_equal({'silent': 0, 'noremap': 0, 'lhs': 'foo<C-V>',
+ call assert_equal({'silent': 0, 'noremap': 0, 'script': 0, 'lhs': 'foo<C-V>',
\ 'mode': ' ', 'nowait': 0, 'expr': 0, 'sid': sid, 'lnum': lnum + 1,
\ 'rhs': 'is<F4>foo', 'buffer': 0},
\ maparg('foo<C-V>', '', 0, 1))
- call assert_equal({'silent': 1, 'noremap': 1, 'lhs': 'bar', 'mode': 'v',
+ call assert_equal({'silent': 1, 'noremap': 1, 'script': 1, 'lhs': 'bar', 'mode': 'v',
\ 'nowait': 0, 'expr': 1, 'sid': sid, 'lnum': lnum + 2,
\ 'rhs': 'isbar', 'buffer': 1},
\ 'bar'->maparg('', 0, 1))
let lnum = expand('<sflnum>')
map <buffer> <nowait> foo bar
- call assert_equal({'silent': 0, 'noremap': 0, 'lhs': 'foo', 'mode': ' ',
+ call assert_equal({'silent': 0, 'noremap': 0, 'script': 0, 'lhs': 'foo', 'mode': ' ',
\ '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',
+ call assert_equal({'silent': 0, 'noremap': 0, 'script': 0, 'lhs': 'baz', 'mode': 't',
\ 'nowait': 0, 'expr': 0, 'sid': sid, 'lnum': lnum + 1, 'rhs': 'foo',
\ 'buffer': 0},
\ maparg('baz', 't', 0, 1))
diff --git a/src/version.c b/src/version.c
index 0353720775..31f2f74bf8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 491,
+/**/
490,
/**/
489,