Skip to content

Commit

Permalink
feat(ui): show the loaded icon for local plugins in a different color
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 13, 2023
1 parent 652b6fe commit 96dd205
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions lua/lazy/view/colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ M.colors = {
Prop = "Conceal", -- property
Value = "@string", -- value of a property
NoCond = "DiagnosticWarn", -- unloaded icon for a plugin where `cond()` was false
Local = "Constant",
ProgressDone = "Constant", -- progress bar done
ProgressTodo = "LineNr", -- progress bar todo
Special = "@punctuation.special",
Expand Down
9 changes: 5 additions & 4 deletions lua/lazy/view/render.lua
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,13 @@ end

---@param plugin LazyPlugin
function M:plugin(plugin)
local hl = plugin._.is_local and "LazyLocal" or "LazySpecial"
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
self:append(" " .. Config.options.ui.icons.not_loaded .. " ", "LazyNoCond"):append(plugin.name)
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
local plugin_start = self:row()
if plugin._.loaded then
Expand All @@ -403,9 +404,9 @@ function M:plugin(plugin)
if plugin[handler] then
local trigger = {}
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
reason[handler] = table.concat(trigger, ' ')
reason[handler] = table.concat(trigger, " ")
end
end
for _, other in pairs(Config.plugins) do
Expand Down

0 comments on commit 96dd205

Please sign in to comment.