feat(ui): show when plugin would be loaded for unloaded plugins. Fixes #261

This commit is contained in:
Folke Lemaitre 2022-12-31 08:41:34 +01:00
parent d02a10d832
commit 5575d2b2a9
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 16 additions and 0 deletions

View File

@ -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()