mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
fix(lualine): dynamically fetch the color used in lualine
This commit is contained in:
parent
3ac62a4364
commit
013243c30d
1 changed files with 7 additions and 5 deletions
|
|
@ -5,9 +5,9 @@ local M = {}
|
|||
---@param status fun(): nil|"ok"|"error"|"pending"
|
||||
function M.status(icon, status)
|
||||
local colors = {
|
||||
ok = LazyVim.ui.fg("Special"),
|
||||
error = LazyVim.ui.fg("DiagnosticError"),
|
||||
pending = LazyVim.ui.fg("DiagnosticWarn"),
|
||||
ok = "Special",
|
||||
error = "DiagnosticError",
|
||||
pending = "DiagnosticWarn",
|
||||
}
|
||||
return {
|
||||
function()
|
||||
|
|
@ -17,7 +17,7 @@ function M.status(icon, status)
|
|||
return status() ~= nil
|
||||
end,
|
||||
color = function()
|
||||
return colors[status()] or colors.ok
|
||||
return LazyVim.ui.fg(colors[status()] or colors.ok)
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
|
@ -145,7 +145,9 @@ function M.root_dir(opts)
|
|||
parent = true,
|
||||
other = true,
|
||||
icon = " ",
|
||||
color = LazyVim.ui.fg("Special"),
|
||||
color = function()
|
||||
return LazyVim.ui.fg("Special")
|
||||
end,
|
||||
}, opts or {})
|
||||
|
||||
local function get()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue