From 96dd2058fb5427d87589825ad6001ad017548e81 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 13 May 2023 13:24:38 +0200 Subject: [PATCH] feat(ui): show the loaded icon for local plugins in a different color --- lua/lazy/view/colors.lua | 1 + lua/lazy/view/render.lua | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lua/lazy/view/colors.lua b/lua/lazy/view/colors.lua index 333af82..6d43f1f 100644 --- a/lua/lazy/view/colors.lua +++ b/lua/lazy/view/colors.lua @@ -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", diff --git a/lua/lazy/view/render.lua b/lua/lazy/view/render.lua index 36e1f96..d5bc9df 100644 --- a/lua/lazy/view/render.lua +++ b/lua/lazy/view/render.lua @@ -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 @@ -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