Skip to content

Commit

Permalink
fix: give focus back to correct window when closing (#72)
Browse files Browse the repository at this point in the history
fixes #59
  • Loading branch information
deecewan committed Oct 22, 2021
1 parent 7c93271 commit a736b8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/trouble/view.lua
Expand Up @@ -231,7 +231,7 @@ function View:close_preview()
local valid_buf = self.parent_state and vim.api.nvim_buf_is_valid(self.parent_state.buf)

if self.parent_state and valid_buf and valid_win then
vim.api.nvim_win_set_buf(self.parent, self.parent_state.buf)
View.switch_to(self.parent, self.parent_state.buf)
vim.api.nvim_win_set_cursor(self.parent, self.parent_state.cursor)
end

Expand Down

0 comments on commit a736b8d

Please sign in to comment.