fix(ui): use Snacks.util.color
instead of LazyVim.ui.fg
This commit is contained in:
@ -109,25 +109,25 @@ return {
|
|||||||
{
|
{
|
||||||
function() return require("noice").api.status.command.get() end,
|
function() return require("noice").api.status.command.get() end,
|
||||||
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() 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
|
-- stylua: ignore
|
||||||
{
|
{
|
||||||
function() return require("noice").api.status.mode.get() end,
|
function() return require("noice").api.status.mode.get() end,
|
||||||
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() 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
|
-- stylua: ignore
|
||||||
{
|
{
|
||||||
function() return " " .. require("dap").status() end,
|
function() return " " .. require("dap").status() end,
|
||||||
cond = function() return package.loaded["dap"] and 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
|
-- stylua: ignore
|
||||||
{
|
{
|
||||||
require("lazy.status").updates,
|
require("lazy.status").updates,
|
||||||
cond = require("lazy.status").has_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",
|
"diff",
|
||||||
|
@ -13,6 +13,12 @@ M.moved = {
|
|||||||
ui = {
|
ui = {
|
||||||
statuscolumn = { "Snacks.statuscolumn" },
|
statuscolumn = { "Snacks.statuscolumn" },
|
||||||
bufremove = { "Snacks.bufdelete" },
|
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
|
if M.moved[name][k] then
|
||||||
local to = M.moved[name][k][1]
|
local to = M.moved[name][k][1]
|
||||||
LazyVim.deprecate("LazyVim." .. name .. "." .. k, to)
|
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 })))
|
local ret = vim.tbl_get(_G, unpack(vim.split(to, ".", { plain = true })))
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
@ -17,7 +17,7 @@ function M.status(icon, status)
|
|||||||
return status() ~= nil
|
return status() ~= nil
|
||||||
end,
|
end,
|
||||||
color = function()
|
color = function()
|
||||||
return LazyVim.ui.fg(colors[status()] or colors.ok)
|
return { fg = Snacks.util.color(colors[status()] or colors.ok) }
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -146,7 +146,7 @@ function M.root_dir(opts)
|
|||||||
other = true,
|
other = true,
|
||||||
icon = " ",
|
icon = " ",
|
||||||
color = function()
|
color = function()
|
||||||
return LazyVim.ui.fg("Special")
|
return { fg = Snacks.util.color("Special") }
|
||||||
end,
|
end,
|
||||||
}, opts or {})
|
}, opts or {})
|
||||||
|
|
||||||
|
@ -24,11 +24,4 @@ function M.foldexpr()
|
|||||||
return vim.b[buf].ts_folds and vim.treesitter.foldexpr() or "0"
|
return vim.b[buf].ts_folds and vim.treesitter.foldexpr() or "0"
|
||||||
end
|
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
|
return M
|
||||||
|
Reference in New Issue
Block a user