1
0
forked from aniani/vim

patch 8.2.1782: Vim9: cannot pass boolean to mapset()

Problem:    Vim9: cannot pass boolean to mapset().
Solution:   Use get_tv_bool(). (closes #7041)
This commit is contained in:
Bram Moolenaar
2020-10-01 21:37:21 +02:00
parent 4537bcc889
commit 74273e6691
3 changed files with 11 additions and 1 deletions

View File

@@ -2307,7 +2307,7 @@ f_mapset(typval_T *argvars, typval_T *rettv UNUSED)
if (which == NULL) if (which == NULL)
return; return;
mode = get_map_mode(&which, 0); 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) if (argvars[2].v_type != VAR_DICT)
{ {

View File

@@ -1721,6 +1721,14 @@ def Test_mapcheck()
iunabbrev foo iunabbrev foo
enddef 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() def Test_nr2char()
nr2char(97, true)->assert_equal('a') nr2char(97, true)->assert_equal('a')
enddef enddef

View File

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