summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-01-01 15:11:04 +0100
committerBram Moolenaar <Bram@vim.org>2021-01-01 15:11:04 +0100
commita8b8af19e48e1803e20a129e9aebab1aac544956 (patch)
tree7c45001645f0b5cb6c7cc53eb2e7e8e93da439a3
parentd5ea8f08f78d20fde8773663894de5e8c023bd83 (diff)
downloadvim-git-a8b8af19e48e1803e20a129e9aebab1aac544956.tar.gz
patch 8.2.2262: Vim9: converting bool to string prefixes v:v8.2.2262
Problem: Vim9: converting bool to string prefixes v:. Solution: Do not use the v: prefix.
-rw-r--r--src/evalvars.c4
-rw-r--r--src/testdir/test_vim9_disassemble.vim4
-rw-r--r--src/testdir/test_vim9_expr.vim9
-rw-r--r--src/version.c2
4 files changed, 13 insertions, 6 deletions
diff --git a/src/evalvars.c b/src/evalvars.c
index f9b3c486c..9f84d76ef 100644
--- 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
index baac5871f..fa5122425 100644
--- 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('<SNR>\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
index e77c1f7e6..8fe041899 100644
--- 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
index b016c289e..ceea2777f 100644
--- 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,