patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Problem: Vim9: finding global function without g: prefix but not finding
global variable is inconsistent.
Solution: Require using g: for a global function. Change the vim9.vim
script into a Vim9 script with exports. Fix that import in legacy
script does not work.
diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim
index 5476008..9870b2e 100644
--- a/src/testdir/test_highlight.vim
+++ b/src/testdir/test_highlight.vim
@@ -4,7 +4,7 @@
source screendump.vim
source check.vim
source script_util.vim
-source vim9.vim
+import './vim9.vim' as v9
func ClearDict(d)
for k in keys(a:d)
@@ -1011,7 +1011,7 @@
call assert_equal([], hlget(test_null_string()))
call assert_equal([], hlget(""))
END
- call CheckLegacyAndVim9Success(lines)
+ call v9.CheckLegacyAndVim9Success(lines)
" Test for resolving highlight group links
let lines =<< trim END
@@ -1042,7 +1042,7 @@
call assert_equal([{'id': hlgCid, 'name': 'hlgC',
\ 'term': {'bold': v:true}}], hlget('hlgC', v:true))
END
- call CheckLegacyAndVim9Success(lines)
+ call v9.CheckLegacyAndVim9Success(lines)
call assert_fails('call hlget([])', 'E1174:')
call assert_fails('call hlget("abc", "xyz")', 'E1212:')
@@ -1098,7 +1098,7 @@
call assert_equal('Search', hlget('NewHLGroup')[0].linksto)
highlight clear NewHLGroup
END
- call CheckLegacyAndVim9Success(lines)
+ call v9.CheckLegacyAndVim9Success(lines)
" Test for clearing the 'term', 'cterm' and 'gui' attributes of a highlight
" group.
@@ -1117,7 +1117,7 @@
\ hlget('myhlg1'))
highlight clear myhlg1
END
- call CheckLegacyAndVim9Success(lines)
+ call v9.CheckLegacyAndVim9Success(lines)
" Test for setting all the 'term', 'cterm' and 'gui' attributes of a
" highlight group
@@ -1134,7 +1134,7 @@
call assert_equal([{'id': id2, 'name': 'myhlg2', 'gui': attr,
\ 'term': attr, 'cterm': attr}], hlget('myhlg2'))
END
- call CheckLegacyAndVim9Success(lines)
+ call v9.CheckLegacyAndVim9Success(lines)
" Test for clearing some of the 'term', 'cterm' and 'gui' attributes of a
" highlight group
@@ -1150,7 +1150,7 @@
call assert_equal([{'id': id2, 'name': 'myhlg2', 'gui': attr,
\ 'term': attr, 'cterm': attr}], hlget('myhlg2'))
END
- call CheckLegacyAndVim9Success(lines)
+ call v9.CheckLegacyAndVim9Success(lines)
" Test for clearing the attributes and link of a highlight group
let lines =<< trim END
@@ -1162,7 +1162,7 @@
\ hlget('myhlg3'))
highlight clear hlg3
END
- call CheckLegacyAndVim9Success(lines)
+ call v9.CheckLegacyAndVim9Success(lines)
" Test for setting default attributes for a highlight group
let lines =<< trim END
@@ -1187,7 +1187,7 @@
\ hlget('hlg6'))
highlight clear hlg6
END
- call CheckLegacyAndVim9Success(lines)
+ call v9.CheckLegacyAndVim9Success(lines)
" Test for setting default links for a highlight group
let lines =<< trim END
@@ -1217,7 +1217,7 @@
\ 'linksto': 'ErrorMsg'}], hlget('hlg9dup'))
highlight clear hlg9
END
- call CheckLegacyAndVim9Success(lines)
+ call v9.CheckLegacyAndVim9Success(lines)
" Test for force creating a link to a highlight group
let lines =<< trim END
@@ -1231,7 +1231,7 @@
\ 'linksto': 'Search'}], hlget('hlg10'))
highlight clear hlg10
END
- call CheckLegacyAndVim9Success(lines)
+ call v9.CheckLegacyAndVim9Success(lines)
" Test for empty values of attributes
call hlset([{'name': 'hlg11', 'cterm': {}}])