Patch 8.2.1613
Problem:    Vim9: cannot pass "true" to prop_type_add().
Solution:   Use tv_get_bool(). (closes #6850)
Files:      src/textprop.c, src/testdir/test_textprop.vim


*** ../vim-8.2.1612/src/textprop.c      2020-09-05 20:50:46.073722860 +0200
--- src/textprop.c      2020-09-05 20:59:33.416518991 +0200
***************
*** 1007,1013 ****
        di = dict_find(dict, (char_u *)"combine", -1);
        if (di != NULL)
        {
!           if (tv_get_number(&di->di_tv))
                prop->pt_flags |= PT_FLAG_COMBINE;
            else
                prop->pt_flags &= ~PT_FLAG_COMBINE;
--- 1007,1013 ----
        di = dict_find(dict, (char_u *)"combine", -1);
        if (di != NULL)
        {
!           if (tv_get_bool(&di->di_tv))
                prop->pt_flags |= PT_FLAG_COMBINE;
            else
                prop->pt_flags &= ~PT_FLAG_COMBINE;
***************
*** 1020,1026 ****
        di = dict_find(dict, (char_u *)"start_incl", -1);
        if (di != NULL)
        {
!           if (tv_get_number(&di->di_tv))
                prop->pt_flags |= PT_FLAG_INS_START_INCL;
            else
                prop->pt_flags &= ~PT_FLAG_INS_START_INCL;
--- 1020,1026 ----
        di = dict_find(dict, (char_u *)"start_incl", -1);
        if (di != NULL)
        {
!           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,1035 ****
        di = dict_find(dict, (char_u *)"end_incl", -1);
        if (di != NULL)
        {
!           if (tv_get_number(&di->di_tv))
                prop->pt_flags |= PT_FLAG_INS_END_INCL;
            else
                prop->pt_flags &= ~PT_FLAG_INS_END_INCL;
--- 1029,1035 ----
        di = dict_find(dict, (char_u *)"end_incl", -1);
        if (di != NULL)
        {
!           if (tv_get_bool(&di->di_tv))
                prop->pt_flags |= PT_FLAG_INS_END_INCL;
            else
                prop->pt_flags &= ~PT_FLAG_INS_END_INCL;
*** ../vim-8.2.1612/src/testdir/test_textprop.vim       2020-09-05 
20:50:46.073722860 +0200
--- src/testdir/test_textprop.vim       2020-09-05 20:59:07.640578373 +0200
***************
*** 321,326 ****
--- 321,337 ----
    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()
*** ../vim-8.2.1612/src/version.c       2020-09-05 20:50:46.073722860 +0200
--- src/version.c       2020-09-05 20:53:50.449305213 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1613,
  /**/

-- 
The early bird gets the worm. The second mouse gets the cheese.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202009051901.085J17kT686592%40masaka.moolenaar.net.

Raspunde prin e-mail lui