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_mapping.vim b/src/testdir/test_mapping.vim
index aae3444..b9c9fa5 100644
--- a/src/testdir/test_mapping.vim
+++ b/src/testdir/test_mapping.vim
@@ -4,7 +4,7 @@
source check.vim
source screendump.vim
source term_util.vim
-source vim9.vim
+import './vim9.vim' as v9
func Test_abbreviation()
" abbreviation with 0x80 should work
@@ -1415,7 +1415,7 @@
vim9script
nnoremap <F3> <ScriptCmd>eval 1 + 2<CR>
END
- call CheckScriptSuccess(lines)
+ call v9.CheckScriptSuccess(lines)
call feedkeys("\<F3>:let g:result = 3+4\<CR>", 'xtc')
call assert_equal(7, g:result)
@@ -1431,7 +1431,7 @@
g:func_called = 'yes'
enddef
END
- call CheckScriptSuccess(lines)
+ call v9.CheckScriptSuccess(lines)
call feedkeys("y\<F3>\<Esc>", 'xtc')
call assert_equal('yes', g:func_called)
@@ -1449,7 +1449,7 @@
feedkeys("\<F3>\<CR>", 'xct')
assert_equal(123, b:result)
END
- call CheckScriptSuccess(lines)
+ call v9.CheckScriptSuccess(lines)
nunmap <F3>
unlet b:result