mirror of
https://github.com/neovim/neovim.git
synced 2026-05-04 04:55:16 +00:00
vim-patch:9.1.1013: Vim9: Regression caused by patch v9.1.0646
Problem: Vim9: Regression caused by patch v9.1.0646
Solution: Translate the function name before invoking it in call()
(Yegappan Lakshmanan)
fixes: vim/vim#16430
closes: vim/vim#16445
6289f91591
N/A patch:
vim-patch:8.2.4176: Vim9: cannot use imported function with call()
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -188,7 +188,10 @@ describe('context functions', function()
|
||||
function RestoreFuncs()
|
||||
call ctxpop()
|
||||
endfunction
|
||||
|
||||
let g:sid = expand('<SID>')
|
||||
]])
|
||||
local sid = api.nvim_get_var('sid')
|
||||
|
||||
eq('Hello, World!', exec_capture([[call Greet('World')]]))
|
||||
eq(
|
||||
@@ -200,11 +203,11 @@ describe('context functions', function()
|
||||
call('DeleteSFuncs')
|
||||
|
||||
eq(
|
||||
'function Greet, line 1: Vim(call):E117: Unknown function: s:greet',
|
||||
('function Greet, line 1: Vim(call):E117: Unknown function: %sgreet'):format(sid),
|
||||
pcall_err(command, [[call Greet('World')]])
|
||||
)
|
||||
eq(
|
||||
'function GreetAll, line 1: Vim(call):E117: Unknown function: s:greet_all',
|
||||
('function GreetAll, line 1: Vim(call):E117: Unknown function: %sgreet_all'):format(sid),
|
||||
pcall_err(command, [[call GreetAll('World', 'One', 'Two', 'Three')]])
|
||||
)
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ func Test_script_local_func()
|
||||
" Try to call a script local function in global scope
|
||||
let lines =<< trim [CODE]
|
||||
:call assert_fails('call s:Xfunc()', 'E81:')
|
||||
:call assert_fails('let x = call("<SID>Xfunc", [])', 'E120:')
|
||||
:call assert_fails('let x = call("<SID>Xfunc", [])', ['E81:', 'E117:'])
|
||||
:call writefile(v:errors, 'Xresult')
|
||||
:qall
|
||||
|
||||
|
||||
Reference in New Issue
Block a user