Skip to content

Commit

Permalink
fix: utilize bufhidden=wipe instead of forcibly deleting buffer (#238)
Browse files Browse the repository at this point in the history
This fixes issues with autocmds such as `WinLeave` not firing,
presumable due to the fact that the floating window gets disposed of
when its buffer is deleted. This breaks plugins such as
[tint.nvim][tint.nvim] who rely on `WinLeave` to function properly.

[tint.nvim]: levouh/tint.nvim#38
  • Loading branch information
williamboman authored Apr 27, 2023
1 parent 98c7ae9 commit 972a7dc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions lua/neotest/client/strategies/integrated/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ return function(spec)
buffer = attach_buf,
})
vim.api.nvim_buf_set_option(attach_buf, "filetype", "neotest-attach")
vim.api.nvim_buf_set_option(attach_buf, "bufhidden", "wipe")
attach_win:jump_to()
end,
result = function()
Expand Down
1 change: 0 additions & 1 deletion lua/neotest/consumers/output.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ local function open_output(result, opts)
end

local on_close = function()
pcall(vim.api.nvim_buf_delete, buf, { force = true })
pcall(vim.fn.chanclose, chan)
win = nil
end
Expand Down

0 comments on commit 972a7dc

Please sign in to comment.