mirror of https://github.com/folke/lazy.nvim.git
feat(ui): show the loaded icon for local plugins in a different color
This commit is contained in:
parent
652b6febf8
commit
96dd2058fb
|
@ -13,6 +13,7 @@ M.colors = {
|
||||||
Prop = "Conceal", -- property
|
Prop = "Conceal", -- property
|
||||||
Value = "@string", -- value of a property
|
Value = "@string", -- value of a property
|
||||||
NoCond = "DiagnosticWarn", -- unloaded icon for a plugin where `cond()` was false
|
NoCond = "DiagnosticWarn", -- unloaded icon for a plugin where `cond()` was false
|
||||||
|
Local = "Constant",
|
||||||
ProgressDone = "Constant", -- progress bar done
|
ProgressDone = "Constant", -- progress bar done
|
||||||
ProgressTodo = "LineNr", -- progress bar todo
|
ProgressTodo = "LineNr", -- progress bar todo
|
||||||
Special = "@punctuation.special",
|
Special = "@punctuation.special",
|
||||||
|
|
|
@ -386,12 +386,13 @@ end
|
||||||
|
|
||||||
---@param plugin LazyPlugin
|
---@param plugin LazyPlugin
|
||||||
function M:plugin(plugin)
|
function M:plugin(plugin)
|
||||||
|
local hl = plugin._.is_local and "LazyLocal" or "LazySpecial"
|
||||||
if plugin._.loaded then
|
if plugin._.loaded then
|
||||||
self:append(" " .. Config.options.ui.icons.loaded .. " ", "LazySpecial"):append(plugin.name)
|
self:append(" " .. Config.options.ui.icons.loaded .. " ", hl):append(plugin.name)
|
||||||
elseif plugin._.cond == false then
|
elseif plugin._.cond == false then
|
||||||
self:append(" " .. Config.options.ui.icons.not_loaded .. " ", "LazyNoCond"):append(plugin.name)
|
self:append(" " .. Config.options.ui.icons.not_loaded .. " ", "LazyNoCond"):append(plugin.name)
|
||||||
else
|
else
|
||||||
self:append(" " .. Config.options.ui.icons.not_loaded .. " ", "LazySpecial"):append(plugin.name)
|
self:append(" " .. Config.options.ui.icons.not_loaded .. " ", hl):append(plugin.name)
|
||||||
end
|
end
|
||||||
local plugin_start = self:row()
|
local plugin_start = self:row()
|
||||||
if plugin._.loaded then
|
if plugin._.loaded then
|
||||||
|
@ -403,9 +404,9 @@ function M:plugin(plugin)
|
||||||
if plugin[handler] then
|
if plugin[handler] then
|
||||||
local trigger = {}
|
local trigger = {}
|
||||||
for _, value in ipairs(plugin[handler]) do
|
for _, value in ipairs(plugin[handler]) do
|
||||||
table.insert(trigger, type(value) == 'table' and value[1] or value)
|
table.insert(trigger, type(value) == "table" and value[1] or value)
|
||||||
end
|
end
|
||||||
reason[handler] = table.concat(trigger, ' ')
|
reason[handler] = table.concat(trigger, " ")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _, other in pairs(Config.plugins) do
|
for _, other in pairs(Config.plugins) do
|
||||||
|
|
Loading…
Reference in New Issue