1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar
2022-01-29 21:45:34 +00:00
parent 135e15251e
commit 62aec93bfd
34 changed files with 3212 additions and 3176 deletions

View File

@@ -4,7 +4,7 @@ source shared.vim
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 @@ func Test_map_script_cmd_restore()
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 @@ func Test_map_script_cmd_finds_func()
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 @@ func Test_map_script_cmd_survives_unmap()
feedkeys("\<F3>\<CR>", 'xct')
assert_equal(123, b:result)
END
call CheckScriptSuccess(lines)
call v9.CheckScriptSuccess(lines)
nunmap <F3>
unlet b:result