Mercurial > vim
diff src/testdir/test_usercommands.vim @ 27457:4c16acb2525f v8.2.4257
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Commit: https://github.com/vim/vim/commit/62aec93bfdb9e1b40d03a6d2e8e9511f8b1bdb2d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 29 21:45:34 2022 +0000
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 29 Jan 2022 23:00:05 +0100 |
parents | 8950a7b6cc89 |
children | 38eab98ef5a9 |
line wrap: on
line diff
--- a/src/testdir/test_usercommands.vim +++ b/src/testdir/test_usercommands.vim @@ -1,6 +1,6 @@ " Tests for user defined commands -source vim9.vim +import './vim9.vim' as v9 " Test for <mods> in user defined commands function Test_cmdmods() @@ -287,13 +287,13 @@ func Test_CmdErrors() vim9script com! -complete=file DoCmd : END - call CheckScriptFailure(lines, 'E1208', 2) + call v9.CheckScriptFailure(lines, 'E1208', 2) let lines =<< trim END vim9script com! -nargs=0 -complete=file DoCmd : END - call CheckScriptFailure(lines, 'E1208', 2) + call v9.CheckScriptFailure(lines, 'E1208', 2) com! -nargs=0 DoCmd : call assert_fails('DoCmd x', 'E488:') @@ -645,7 +645,7 @@ func Test_usercmd_with_block() command DoesNotEnd { echo 'hello' END - call CheckScriptFailure(lines, 'E1026:') + call v9.CheckScriptFailure(lines, 'E1026:') let lines =<< trim END command HelloThere { @@ -653,7 +653,7 @@ func Test_usercmd_with_block() } HelloThere END - call CheckScriptSuccess(lines) + call v9.CheckScriptSuccess(lines) delcommand HelloThere let lines =<< trim END @@ -664,7 +664,7 @@ func Test_usercmd_with_block() } BadCommand END - call CheckScriptFailure(lines, 'E1128:') + call v9.CheckScriptFailure(lines, 'E1128:') endfunc func Test_delcommand_buffer()