From c6d2cbf8f51abfa0c9d244ef384a15b0b69e16c6 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 23 Jan 2025 12:42:38 +0100 Subject: fix(lua): pop retval for fast context LuaRef Problem: nlua_call_ref_ctx() does not pop the return value in fast context that did not error. Solution: Fall through to end; calling nlua_call_pop_retval(). --- test/functional/lua/ui_event_spec.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/functional/lua/ui_event_spec.lua') diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua index 8bfd574fb9..80457555d4 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -423,4 +423,13 @@ describe('vim.ui_attach', function() {100:Press ENTER or type command to continue}^ | ]]) end) + + it('sourcing invalid file does not crash #32166', function() + exec_lua([[ + local ns = vim.api.nvim_create_namespace("") + vim.ui_attach(ns, { ext_messages = true }, function() end) + ]]) + feed((':luafile %s'):format(testlog)) + n.assert_alive() + end) end) -- cgit