Skip to content

Commit

Permalink
fix: Check parent window is valid before setting active (#291)
Browse files Browse the repository at this point in the history
Fixes #284
  • Loading branch information
jgoguen committed Jun 3, 2023
1 parent 324c977 commit c14786d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/trouble/view.lua
Expand Up @@ -335,7 +335,9 @@ end
function View:close()
util.debug("close")
if vim.api.nvim_win_is_valid(self.win) then
vim.api.nvim_set_current_win(self.parent)
if vim.api.nvim_win_is_valid(self.parent) then
vim.api.nvim_set_current_win(self.parent)
end
vim.api.nvim_win_close(self.win, {})
end
if vim.api.nvim_buf_is_valid(self.buf) then
Expand Down

0 comments on commit c14786d

Please sign in to comment.