]> granicus.if.org Git - vim/commitdiff
patch 8.2.1782: Vim9: cannot pass boolean to mapset() v8.2.1782
authorBram Moolenaar <Bram@vim.org>
Thu, 1 Oct 2020 19:37:21 +0000 (21:37 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 1 Oct 2020 19:37:21 +0000 (21:37 +0200)
Problem:    Vim9: cannot pass boolean to mapset().
Solution:   Use get_tv_bool(). (closes #7041)

src/map.c
src/testdir/test_vim9_func.vim
src/version.c

index 6a994d41850ba5784cf247772eda58866857c6ec..b46ba3781d48589efc16a129cdd9073a890abcaf 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -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)
     {
index eec5af62f9281884004da69398971b3be1dd0fcb..509c7fa7e180de78fe645f093e6b12119448504a 100644 (file)
@@ -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
index 01271861863b7b4c663bf82a005ee2975cbf4e09..9619a334efb871627e6f3286fbc227f36b73837e 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1782,
 /**/
     1781,
 /**/