From 53a6c8e4d8cef7193bf290d131c297b49516a11c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3n=C3=A1n=20Carrigan?= Date: Sat, 5 Nov 2022 10:23:53 +0000 Subject: [PATCH] fix(output): listen for close event WinClosed doesn't trigger for the floating window so have to manually listen for it to close. See #139 --- lua/neotest/consumers/output.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/neotest/consumers/output.lua b/lua/neotest/consumers/output.lua index 8771985d..cf2717be 100644 --- a/lua/neotest/consumers/output.lua +++ b/lua/neotest/consumers/output.lua @@ -68,12 +68,14 @@ local function open_output(result, opts) opts.open_win = opts.open_win or function(win_opts) - return lib.ui.float.open({ + local float = lib.ui.float.open({ width = win_opts.width, height = win_opts.height, buffer = buf, auto_close = opts.auto_close, - }).win_id + }) + float:listen("close", on_close) + return float.win_id end local cur_win = vim.api.nvim_get_current_win()