fix(ui): fix buffer being properly deleted (#112)

This commit is contained in:
Sebastian Lyng Johansen 2022-12-22 22:01:01 +01:00 committed by GitHub
parent 3f60f2dc13
commit 9e983898b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -102,12 +102,12 @@ function M.show(mode)
M._buf = nil M._buf = nil
vim.diagnostic.reset(Config.ns, buf) vim.diagnostic.reset(Config.ns, buf)
vim.schedule(function() vim.schedule(function()
if vim.api.nvim_buf_is_valid(buf) then
vim.api.nvim_buf_delete(buf, { force = true })
end
if vim.api.nvim_win_is_valid(win) then if vim.api.nvim_win_is_valid(win) then
vim.api.nvim_win_close(win, true) vim.api.nvim_win_close(win, true)
end end
if vim.api.nvim_buf_is_valid(buf) then
vim.api.nvim_buf_delete(buf, { force = true })
end
end) end)
end end