feat(vimscript): log function name in "fast" message #32616

(cherry picked from commit e42050f4ae)
This commit is contained in:
Matthieu Coudron
2025-10-21 16:46:03 +02:00
committed by github-actions[bot]
parent a7eb110098
commit f9cad88d5a
2 changed files with 20 additions and 1 deletions

View File

@@ -1328,6 +1328,22 @@ describe('lua stdlib', function()
)
end)
it('vim.call fails in fast context', function()
local screen = Screen.new(120, 10)
exec_lua([[
local timer = vim.uv.new_timer()
timer:start(0, 0, function()
timer:close()
vim.call('sin', 0.0)
end)
]])
screen:expect({
any = pesc('E5560: Vimscript function "sin" must not be called in a fast event context'),
})
feed('<CR>')
assert_alive()
end)
it('vim.fn errors when calling API function', function()
matches(
'Tried to call API function with vim.fn: use vim.api.nvim_get_current_line instead',