aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/vim_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-05-26 15:03:07 +0200
committerGitHub <noreply@github.com>2022-05-26 15:03:07 +0200
commit30915cc8b0e8b92cb83a23833c7a1116e20c055d (patch)
tree83d82ea8e54de3d2b8c29218da465af679ea6845 /test/functional/lua/vim_spec.lua
parent497046466e4a969cefce5fc2b7992dde157aa1a5 (diff)
parent8a73e60eb97a0402caf57986ece1e87b7365ae00 (diff)
downloadrneovim-30915cc8b0e8b92cb83a23833c7a1116e20c055d.tar.gz
rneovim-30915cc8b0e8b92cb83a23833c7a1116e20c055d.tar.bz2
rneovim-30915cc8b0e8b92cb83a23833c7a1116e20c055d.zip
Merge pull request #18306 from lewis6991/fnfast
feat(lua): allow some viml functions to run in fast
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
-rw-r--r--test/functional/lua/vim_spec.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index 73e4d7ca79..fd05e6ec0b 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -794,6 +794,20 @@ describe('lua stdlib', function()
pcall_err(exec_lua, "vim.fn.nvim_get_current_line()"))
end)
+ it('vim.fn is allowed in "fast" context by some functions #18306', 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})