mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-21 20:11:06 +00:00
feat(sidekick): fancier lualine component
This commit is contained in:
parent
060e6dfaf7
commit
b889978151
1 changed files with 19 additions and 9 deletions
|
|
@ -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,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue