From 5575d2b2a9eb7e104d85f4f68754ef3734c7a4a1 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 31 Dec 2022 08:41:34 +0100 Subject: [PATCH] feat(ui): show when plugin would be loaded for unloaded plugins. Fixes #261 --- lua/lazy/view/render.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lua/lazy/view/render.lua b/lua/lazy/view/render.lua index 2cc97e0b..0c62436b 100644 --- a/lua/lazy/view/render.lua +++ b/lua/lazy/view/render.lua @@ -374,6 +374,22 @@ function M:plugin(plugin) local plugin_start = self:row() if plugin._.loaded then self:reason(plugin._.loaded) + else + self:append(" ") + local reason = {} + for handler in pairs(Handler.types) do + if plugin[handler] then + for _, value in ipairs(plugin[handler]) do + reason[handler] = value + end + end + end + for _, other in pairs(Config.plugins) do + if vim.tbl_contains(other.dependencies or {}, plugin.name) then + reason.plugin = other.name + end + end + self:reason(reason) end self:diagnostics(plugin) self:nl()