feat(sidekick): fancier lualine component

This commit is contained in:
Folke Lemaitre
2025-09-27 19:53:14 +02:00
parent 060e6dfaf7
commit b889978151

View File

@@ -17,16 +17,26 @@ return {
optional = true,
event = "VeryLazy",
opts = function(_, opts)
table.insert(
opts.sections.lualine_x,
2,
LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function()
local icons = {
Error = { "", "DiagnosticError" },
Inactive = { "", "MsgArea" },
Warning = { "", "DiagnosticWarn" },
Normal = { LazyVim.config.icons.kinds.Copilot, "Special" },
}
table.insert(opts.sections.lualine_x, 2, {
function()
local status = require("sidekick.status").get()
if status then
return status.kind == "Error" and "error" or status.busy and "pending" or "ok"
end
end)
)
return status and vim.tbl_get(icons, status.kind, 1)
end,
cond = function()
return require("sidekick.status").get() ~= nil
end,
color = function()
local status = require("sidekick.status").get()
local hl = status and (status.busy and "DiagnosticWarn" or vim.tbl_get(icons, status.kind, 2))
return { fg = Snacks.util.color(hl) }
end,
})
end,
},