]> granicus.if.org Git - vim/commitdiff
patch 8.2.1613: Vim9: cannot pass "true" to prop_type_add() v8.2.1613
authorBram Moolenaar <Bram@vim.org>
Sat, 5 Sep 2020 19:00:00 +0000 (21:00 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 5 Sep 2020 19:00:00 +0000 (21:00 +0200)
Problem:    Vim9: cannot pass "true" to prop_type_add().
Solution:   Use tv_get_bool(). (closes #6850)

src/testdir/test_textprop.vim
src/textprop.c
src/version.c

index f7718124b346e83500702537653a06438344966d..99ca31a378be1d3d45e7307a1b2a0aef0ca3b7ea 100644 (file)
@@ -321,6 +321,17 @@ func Test_prop_remove()
   bwipe!
 endfunc
 
+def Test_prop_add_vim9()
+  prop_type_add('comment', #{
+      highlight: 'Directory',
+      priority: 123,
+      start_incl: true,
+      end_incl: true,
+      combine: false,
+    })
+  prop_type_delete('comment')
+enddef
+
 def Test_prop_remove_vim9()
   new
   call AddPropTypes()
index c291a295fe4fa31eb177e32dd16ce8dc57e24db9..639c5df8a1cc31953583a5b29c40f5c7f60595a3 100644 (file)
@@ -1007,7 +1007,7 @@ prop_type_set(typval_T *argvars, int add)
        di = dict_find(dict, (char_u *)"combine", -1);
        if (di != NULL)
        {
-           if (tv_get_number(&di->di_tv))
+           if (tv_get_bool(&di->di_tv))
                prop->pt_flags |= PT_FLAG_COMBINE;
            else
                prop->pt_flags &= ~PT_FLAG_COMBINE;
@@ -1020,7 +1020,7 @@ prop_type_set(typval_T *argvars, int add)
        di = dict_find(dict, (char_u *)"start_incl", -1);
        if (di != NULL)
        {
-           if (tv_get_number(&di->di_tv))
+           if (tv_get_bool(&di->di_tv))
                prop->pt_flags |= PT_FLAG_INS_START_INCL;
            else
                prop->pt_flags &= ~PT_FLAG_INS_START_INCL;
@@ -1029,7 +1029,7 @@ prop_type_set(typval_T *argvars, int add)
        di = dict_find(dict, (char_u *)"end_incl", -1);
        if (di != NULL)
        {
-           if (tv_get_number(&di->di_tv))
+           if (tv_get_bool(&di->di_tv))
                prop->pt_flags |= PT_FLAG_INS_END_INCL;
            else
                prop->pt_flags &= ~PT_FLAG_INS_END_INCL;
index 34516ac769b2cff5c72b79f059c80a4537940a83..4b9100cc456ee45224a37c240c6372e00256d36f 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1613,
 /**/
     1612,
 /**/