From 754822a066e6ce92462aa17fce8999472c23b777 Mon Sep 17 00:00:00 2001 From: notomo Date: Fri, 16 Sep 2022 18:06:37 +0900 Subject: fix(lua): free vim.ui_attach callback before lua close (#20205) --- test/functional/lua/ui_event_spec.lua | 12 ++++++++++++ 1 file changed, 12 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 294222ad13..57ffcf7b4e 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -105,4 +105,16 @@ describe('vim.ui_attach', function() } end) + + it('does not crash on exit', function() + helpers.funcs.system({ + helpers.nvim_prog, + '-u', 'NONE', + '-i', 'NONE', + '--cmd', [[ lua ns = vim.api.nvim_create_namespace 'testspace' ]], + '--cmd', [[ lua vim.ui_attach(ns, {ext_popupmenu=true}, function() end) ]], + '--cmd', 'quitall!', + }) + eq(0, helpers.eval('v:shell_error')) + end) end) -- cgit