feat(sidekick): fancier lualine component

This commit is contained in:
Folke Lemaitre 2025-09-27 19:53:14 +02:00
parent 060e6dfaf7
commit b889978151
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

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