Skip to content

Commit

Permalink
feat(strategies/integrated): keep attach win open
Browse files Browse the repository at this point in the history
See #38
  • Loading branch information
rcarriga committed Jun 23, 2022
1 parent c124fb4 commit 6e235a4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lua/neotest/client/strategies/integrated/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ return function(spec)
attach_chan = attach_chan
or vim.api.nvim_open_term(attach_buf, {
on_input = function(_, _, _, data)
async.api.nvim_chan_send(job, data)
pcall(async.api.nvim_chan_send, job, data)
end,
})
attach_win = lib.ui.float.open({
Expand All @@ -86,11 +86,10 @@ return function(spec)
if result_code == nil then
finish_cond:wait()
end
pcall(async.fn.chanclose, job)
output_file:close()
pcall(async.fn.chanclose, job)
if attach_win then
vim.schedule(function()
attach_win:close(true)
attach_win:listen("close", function()
pcall(vim.api.nvim_buf_delete, attach_buf, { force = true })
pcall(vim.fn.chanclose, attach_chan)
end)
Expand Down

0 comments on commit 6e235a4

Please sign in to comment.