From e61228a214ebda9845db9462dad0a8c362d3963f Mon Sep 17 00:00:00 2001 From: bfredl Date: Mon, 11 Nov 2024 22:15:19 +0100 Subject: fix(tests): needing two calls to setup a screen is cringe Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session. --- test/functional/lua/loop_spec.lua | 1 - 1 file changed, 1 deletion(-) (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 de8200a5f1..0c72843fad 100644 --- a/test/functional/lua/loop_spec.lua +++ b/test/functional/lua/loop_spec.lua @@ -65,7 +65,6 @@ describe('vim.uv', function() it('is API safe', function() local screen = Screen.new(50, 10) - screen:attach() screen:set_default_attr_ids({ [1] = { bold = true, foreground = Screen.colors.Blue1 }, [2] = { bold = true, reverse = true }, -- cgit From de48fbbd5f8800bd7f1909a6fb41e53e871cf74c Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 20 Jun 2024 14:48:06 +0200 Subject: fix(messages)!: vim.ui_attach message callbacks are unsafe Problem: Lua callbacks for "msg_show" events with vim.ui_attach() are executed when it is not safe. Solution: Disallow non-fast API calls for "msg_show" event callbacks. Automatically detach callback after excessive errors. Make sure fast APIs do not modify Nvim state. --- test/functional/lua/loop_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (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 0c72843fad..52a8fec0bf 100644 --- a/test/functional/lua/loop_spec.lua +++ b/test/functional/lua/loop_spec.lua @@ -87,9 +87,9 @@ describe('vim.uv', function() screen:expect([[ | {2: }| - {3:Error executing luv callback:} | + {3:Error executing callback:} | {3:[string ""]:5: E5560: nvim_set_var must not }| - {3:be called in a lua loop callback} | + {3:be called in a fast event context} | {3:stack traceback:} | {3: [C]: in function 'nvim_set_var'} | {3: [string ""]:5: in function <[string }| -- cgit