Skip to content

Commit

Permalink
fix(float): only clear diagnostics for valid buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 13, 2023
1 parent b73312a commit 7b0d1a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/lazy/view/float.lua
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ function M:close()
local win = self.win
self.win = nil
self.buf = nil
vim.diagnostic.reset(Config.ns, buf)
vim.schedule(function()
if win and vim.api.nvim_win_is_valid(win) then
vim.api.nvim_win_close(win, true)
end
if buf and vim.api.nvim_buf_is_valid(buf) then
vim.diagnostic.reset(Config.ns, buf)
vim.api.nvim_buf_delete(buf, { force = true })
end
end)
Expand Down

0 comments on commit 7b0d1a7

Please sign in to comment.