Skip to content

Commit

Permalink
fix: properly close trouble window on close
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 10, 2021
1 parent 2c9b319 commit d10ee4b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/trouble/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,15 @@ function View:switch_to_parent()
View.switch_to(self.parent)
end

function View:close() vim.api.nvim_buf_delete(self.buf, {}) end
function View:close()
util.debug("close")
if vim.api.nvim_win_is_valid(self.win) then
vim.api.nvim_win_close(self.win, {})
end
if vim.api.nvim_buf_is_valid(self.buf) then
vim.api.nvim_buf_delete(self.buf, {})
end
end

function View.create(opts)
opts = opts or {}
Expand Down

0 comments on commit d10ee4b

Please sign in to comment.