mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-12-25 12:14:19 +01:00
feat(sidekick): fancier lualine component
This commit is contained in:
@@ -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,
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user