fix(ui): get_plugin should return when ui is not showing

This commit is contained in:
Folke Lemaitre 2023-01-10 11:19:47 +01:00
parent 18eb724dff
commit 5faadf6398
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 0 deletions

View File

@ -91,6 +91,9 @@ end
---@param row? number ---@param row? number
---@return LazyPlugin? ---@return LazyPlugin?
function M:get_plugin(row) function M:get_plugin(row)
if not (self.view.win and vim.api.nvim_win_is_valid(self.view.win)) then
return
end
row = row or vim.api.nvim_win_get_cursor(self.view.win)[1] row = row or vim.api.nvim_win_get_cursor(self.view.win)[1]
for _, loc in ipairs(self.locations) do for _, loc in ipairs(self.locations) do
if row >= loc.from and row <= loc.to then if row >= loc.from and row <= loc.to then