Skip to content

Commit

Permalink
fix(output): listen for close event
Browse files Browse the repository at this point in the history
WinClosed doesn't trigger for the floating window so have to manually
listen for it to close.

See #139
  • Loading branch information
rcarriga committed Nov 5, 2022
1 parent f7db06d commit 53a6c8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/neotest/consumers/output.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 53a6c8e

Please sign in to comment.