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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user