Skip to content

Commit 0e255a2

Browse files
chore(build): auto-generate docs
1 parent 52d87a7 commit 0e255a2

File tree

1 file changed

+38
-18
lines changed

1 file changed

+38
-18
lines changed

docs/extras/ai/sidekick.md

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,26 @@ end
111111

112112
```lua
113113
opts = function(_, opts)
114-
table.insert(
115-
opts.sections.lualine_x,
116-
2,
117-
LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function()
114+
local icons = {
115+
Error = { "", "DiagnosticError" },
116+
Inactive = { "", "MsgArea" },
117+
Warning = { "", "DiagnosticWarn" },
118+
Normal = { LazyVim.config.icons.kinds.Copilot, "Special" },
119+
}
120+
table.insert(opts.sections.lualine_x, 2, {
121+
function()
118122
local status = require("sidekick.status").get()
119-
if status then
120-
return status.kind == "Error" and "error" or status.busy and "pending" or "ok"
121-
end
122-
end)
123-
)
123+
return status and vim.tbl_get(icons, status.kind, 1)
124+
end,
125+
cond = function()
126+
return require("sidekick.status").get() ~= nil
127+
end,
128+
color = function()
129+
local status = require("sidekick.status").get()
130+
local hl = status and (status.busy and "DiagnosticWarn" or vim.tbl_get(icons, status.kind, 2))
131+
return { fg = Snacks.util.color(hl) }
132+
end,
133+
})
124134
end
125135
```
126136

@@ -135,16 +145,26 @@ end
135145
optional = true,
136146
event = "VeryLazy",
137147
opts = function(_, opts)
138-
table.insert(
139-
opts.sections.lualine_x,
140-
2,
141-
LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function()
148+
local icons = {
149+
Error = { "", "DiagnosticError" },
150+
Inactive = { "", "MsgArea" },
151+
Warning = { "", "DiagnosticWarn" },
152+
Normal = { LazyVim.config.icons.kinds.Copilot, "Special" },
153+
}
154+
table.insert(opts.sections.lualine_x, 2, {
155+
function()
156+
local status = require("sidekick.status").get()
157+
return status and vim.tbl_get(icons, status.kind, 1)
158+
end,
159+
cond = function()
160+
return require("sidekick.status").get() ~= nil
161+
end,
162+
color = function()
142163
local status = require("sidekick.status").get()
143-
if status then
144-
return status.kind == "Error" and "error" or status.busy and "pending" or "ok"
145-
end
146-
end)
147-
)
164+
local hl = status and (status.busy and "DiagnosticWarn" or vim.tbl_get(icons, status.kind, 2))
165+
return { fg = Snacks.util.color(hl) }
166+
end,
167+
})
148168
end,
149169
}
150170
```

0 commit comments

Comments
 (0)