# HG changeset patch # User Bram Moolenaar # Date 1609510503 -3600 # Node ID 4c6ebf531284420f795bfa51277ef7edcc336860 # Parent b441dd39a45021271ba378318f9b14dce7feb80a patch 8.2.2262: Vim9: converting bool to string prefixes v: Commit: https://github.com/vim/vim/commit/a8b8af19e48e1803e20a129e9aebab1aac544956 Author: Bram Moolenaar Date: Fri Jan 1 15:11:04 2021 +0100 patch 8.2.2262: Vim9: converting bool to string prefixes v: Problem: Vim9: converting bool to string prefixes v:. Solution: Do not use the v: prefix. diff --git a/src/evalvars.c b/src/evalvars.c --- a/src/evalvars.c +++ b/src/evalvars.c @@ -2068,8 +2068,8 @@ get_var_special_name(int nr) { switch (nr) { - case VVAL_FALSE: return "v:false"; - case VVAL_TRUE: return "v:true"; + case VVAL_FALSE: return in_vim9script() ? "false" : "v:false"; + case VVAL_TRUE: return in_vim9script() ? "true" : "v:true"; case VVAL_NONE: return "v:none"; case VVAL_NULL: return "v:null"; } diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim --- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -182,7 +182,7 @@ def Test_disassemble_push() var res = execute('disass s:ScriptFuncPush') assert_match('\d*_ScriptFuncPush.*' .. 'localbool = true.*' .. - ' PUSH v:true.*' .. + ' PUSH true.*' .. 'localspec = v:none.*' .. ' PUSH v:none.*' .. 'localblob = 0z1234.*' .. @@ -1461,7 +1461,7 @@ def Test_disassemble_invert_bool() var instr = execute('disassemble InvertBool') assert_match('InvertBool\_s*' .. 'var flag = true\_s*' .. - '\d PUSH v:true\_s*' .. + '\d PUSH true\_s*' .. '\d STORE $0\_s*' .. 'var invert = !flag\_s*' .. '\d LOAD $0\_s*' .. diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -1056,14 +1056,19 @@ def Test_expr5() assert_equal('123 hello', 123 .. ' hello') assert_equal('123456', 123 .. 456) - assert_equal('av:true', 'a' .. true) - assert_equal('av:false', 'a' .. false) + assert_equal('atrue', 'a' .. true) + assert_equal('afalse', 'a' .. false) assert_equal('av:null', 'a' .. v:null) assert_equal('av:none', 'a' .. v:none) if has('float') assert_equal('a0.123', 'a' .. 0.123) endif + set digraph + assert_equal('val: true', 'val: ' .. &digraph) + set nodigraph + assert_equal('val: false', 'val: ' .. &digraph) + assert_equal([1, 2, 3, 4], [1, 2] + [3, 4]) assert_equal(0z11223344, 0z1122 + 0z3344) assert_equal(0z112201ab, 0z1122 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 */ /**/ + 2262, +/**/ 2261, /**/ 2260,