mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 16:39:06 +02:00
fix(ui): use Snacks.util.color
instead of LazyVim.ui.fg
This commit is contained in:
parent
e389a5ada9
commit
6d774ba8f2
4 changed files with 15 additions and 13 deletions
|
@ -109,25 +109,25 @@ return {
|
|||
{
|
||||
function() return require("noice").api.status.command.get() end,
|
||||
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
|
||||
color = function() return LazyVim.ui.fg("Statement") end,
|
||||
color = function() return { fg = Snacks.util.color("Statement") } end,
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return require("noice").api.status.mode.get() end,
|
||||
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
|
||||
color = function() return LazyVim.ui.fg("Constant") end,
|
||||
color = function() return { fg = Snacks.util.color("Constant") } end,
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return " " .. require("dap").status() end,
|
||||
cond = function() return package.loaded["dap"] and require("dap").status() ~= "" end,
|
||||
color = function() return LazyVim.ui.fg("Debug") end,
|
||||
color = function() return { fg = Snacks.util.color("Debug") } end,
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
require("lazy.status").updates,
|
||||
cond = require("lazy.status").has_updates,
|
||||
color = function() return LazyVim.ui.fg("Special") end,
|
||||
color = function() return { fg = Snacks.util.color("Special") } end,
|
||||
},
|
||||
{
|
||||
"diff",
|
||||
|
|
|
@ -13,6 +13,12 @@ M.moved = {
|
|||
ui = {
|
||||
statuscolumn = { "Snacks.statuscolumn" },
|
||||
bufremove = { "Snacks.bufdelete" },
|
||||
fg = {
|
||||
"{ fg = Snacks.util.color(...) }",
|
||||
fn = function(...)
|
||||
return { fg = Snacks.util.color(...) }
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -33,6 +39,9 @@ function M.decorate(name, mod)
|
|||
if M.moved[name][k] then
|
||||
local to = M.moved[name][k][1]
|
||||
LazyVim.deprecate("LazyVim." .. name .. "." .. k, to)
|
||||
if M.moved[name][k].fn then
|
||||
return M.moved[name][k].fn
|
||||
end
|
||||
local ret = vim.tbl_get(_G, unpack(vim.split(to, ".", { plain = true })))
|
||||
return ret
|
||||
end
|
||||
|
|
|
@ -17,7 +17,7 @@ function M.status(icon, status)
|
|||
return status() ~= nil
|
||||
end,
|
||||
color = function()
|
||||
return LazyVim.ui.fg(colors[status()] or colors.ok)
|
||||
return { fg = Snacks.util.color(colors[status()] or colors.ok) }
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
@ -146,7 +146,7 @@ function M.root_dir(opts)
|
|||
other = true,
|
||||
icon = " ",
|
||||
color = function()
|
||||
return LazyVim.ui.fg("Special")
|
||||
return { fg = Snacks.util.color("Special") }
|
||||
end,
|
||||
}, opts or {})
|
||||
|
||||
|
|
|
@ -24,11 +24,4 @@ function M.foldexpr()
|
|||
return vim.b[buf].ts_folds and vim.treesitter.foldexpr() or "0"
|
||||
end
|
||||
|
||||
---@return {fg?:string}?
|
||||
function M.fg(name)
|
||||
local hl = vim.api.nvim_get_hl(0, { name = name, link = false })
|
||||
local fg = hl and hl.fg or hl.foreground
|
||||
return fg and { fg = string.format("#%06x", fg) } or nil
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue