# HG changeset patch # User Bram Moolenaar # Date 1601581503 -7200 # Node ID 990b47e15cd70b14e0bad03b7c70eb0774b9ec50 # Parent e841e4b7ef2ae226250c257056676c71080f61d8 patch 8.2.1782: Vim9: cannot pass boolean to mapset() Commit: https://github.com/vim/vim/commit/74273e66914e46eb5814c13a1b888e45358859b6 Author: Bram Moolenaar Date: Thu Oct 1 21:37:21 2020 +0200 patch 8.2.1782: Vim9: cannot pass boolean to mapset() Problem: Vim9: cannot pass boolean to mapset(). Solution: Use get_tv_bool(). (closes https://github.com/vim/vim/issues/7041) diff --git a/src/map.c b/src/map.c --- a/src/map.c +++ b/src/map.c @@ -2307,7 +2307,7 @@ f_mapset(typval_T *argvars, typval_T *re 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 --- 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 :echo "hit F3" + var mapsave = maparg('', 'n', false, true) + mapset('n', false, mapsave) + + nunmap +enddef + def Test_nr2char() nr2char(97, true)->assert_equal('a') enddef diff --git a/src/version.c b/src/version.c --- 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,