Skip to content

Commit

Permalink
fix(view): check that window is open before checking active item
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 30, 2024
1 parent 7b67bf7 commit 5b5446d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/trouble/view/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ end

---@param cursor? number[]
function M:at(cursor)
if not vim.api.nvim_buf_is_valid(self.win.buf) then
return {}
end
cursor = cursor or vim.api.nvim_win_get_cursor(self.win.win)
return self.renderer:at(cursor[1])
end
Expand Down

0 comments on commit 5b5446d

Please sign in to comment.