From 5faadf6398f99f781a212d2a7cbd39a688d32300 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 10 Jan 2023 11:19:47 +0100 Subject: [PATCH] fix(ui): get_plugin should return when ui is not showing --- lua/lazy/view/render.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazy/view/render.lua b/lua/lazy/view/render.lua index fd4b138..1c0bd3c 100644 --- a/lua/lazy/view/render.lua +++ b/lua/lazy/view/render.lua @@ -91,6 +91,9 @@ end ---@param row? number ---@return LazyPlugin? 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] for _, loc in ipairs(self.locations) do if row >= loc.from and row <= loc.to then