diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-10-01 21:37:21 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-10-01 21:37:21 +0200 |
commit | 74273e66914e46eb5814c13a1b888e45358859b6 (patch) | |
tree | 3f49aca8eaad979e9208ad9c69ea65fc8d215939 | |
parent | 4537bcc88956f86267c25edf8008e0dbde598652 (diff) | |
download | vim-git-74273e66914e46eb5814c13a1b888e45358859b6.tar.gz |
patch 8.2.1782: Vim9: cannot pass boolean to mapset()v8.2.1782
Problem: Vim9: cannot pass boolean to mapset().
Solution: Use get_tv_bool(). (closes #7041)
-rw-r--r-- | src/map.c | 2 | ||||
-rw-r--r-- | src/testdir/test_vim9_func.vim | 8 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 11 insertions, 1 deletions
@@ -2307,7 +2307,7 @@ f_mapset(typval_T *argvars, typval_T *rettv UNUSED) if (which == NULL) return; mode = get_map_mode(&which, 0); - is_abbr = (int)tv_get_number(&argvars[1]); + is_abbr = (int)tv_get_bool(&argvars[1]); if (argvars[2].v_type != VAR_DICT) { diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index eec5af62f..509c7fa7e 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1721,6 +1721,14 @@ def Test_mapcheck() iunabbrev foo enddef +def Test_maparg_mapset() + nnoremap <F3> :echo "hit F3"<CR> + var mapsave = maparg('<F3>', 'n', false, true) + mapset('n', false, mapsave) + + nunmap <F3> +enddef + def Test_nr2char() nr2char(97, true)->assert_equal('a') enddef diff --git a/src/version.c b/src/version.c index 012718618..9619a334e 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1782, +/**/ 1781, /**/ 1780, |