From 1294e221a205f1f3c6d2e31421b674db6e747406 Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 24 Apr 2024 18:40:03 +0200 Subject: fix(lua): vim.fn.has('nvim-0.10') in fast context, used by vim.deprecate --- test/functional/lua/loop_spec.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/functional/lua/loop_spec.lua') diff --git a/test/functional/lua/loop_spec.lua b/test/functional/lua/loop_spec.lua index d5c5cd3cd0..566a171a84 100644 --- a/test/functional/lua/loop_spec.lua +++ b/test/functional/lua/loop_spec.lua @@ -133,6 +133,20 @@ describe('vim.uv', function() {5:-- INSERT --} | ]]) eq({ blocking = false, mode = 'n' }, exec_lua('return _G.mode')) + + exec_lua([[ + local timer = vim.uv.new_timer() + timer:start(20, 0, function () + _G.is_fast = vim.in_fast_event() + timer:close() + _G.value = vim.fn.has("nvim-0.5") + _G.unvalue = vim.fn.has("python3") + end) + ]]) + + screen:expect({ any = [[{3:Vim:E5560: Vimscript function must not be called i}]] }) + feed('') + eq({ 1, nil }, exec_lua('return {_G.value, _G.unvalue}')) end) it("is equal to require('luv')", function() -- cgit