To: vim_dev@googlegroups.com Subject: Patch 8.2.1613 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- 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 ///