mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
feat(lua): allow some viml functions to run in fast
This change adds the necessary plumbing to annotate functions in funcs.c as being allowed in run in luv fast events.
This commit is contained in:
@@ -794,6 +794,20 @@ describe('lua stdlib', function()
|
||||
pcall_err(exec_lua, "vim.fn.nvim_get_current_line()"))
|
||||
end)
|
||||
|
||||
it('vim.fn can be called in fast events (if function is allowed)', function()
|
||||
exec_lua([[
|
||||
local timer = vim.loop.new_timer()
|
||||
timer:start(0, 0, function()
|
||||
timer:close()
|
||||
assert(vim.in_fast_event())
|
||||
vim.g.fnres = vim.fn.iconv('hello', 'utf-8', 'utf-8')
|
||||
end)
|
||||
]])
|
||||
|
||||
helpers.poke_eventloop()
|
||||
eq('hello', exec_lua[[return vim.g.fnres]])
|
||||
end)
|
||||
|
||||
it('vim.rpcrequest and vim.rpcnotify', function()
|
||||
exec_lua([[
|
||||
chan = vim.fn.jobstart({'cat'}, {rpc=true})
|
||||
|
Reference in New Issue
Block a user