forked from zbirenbaum/copilot.lua
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhighlight.lua
More file actions
26 lines (23 loc) · 716 Bytes
/
highlight.lua
File metadata and controls
26 lines (23 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
local mod = {
group = {
CopilotAnnotation = "CopilotAnnotation",
CopilotSuggestion = "CopilotSuggestion",
},
}
local links = {
[mod.group.CopilotAnnotation] = "Comment",
[mod.group.CopilotSuggestion] = "Comment",
}
function mod.setup()
-- Some environments will load themes after plugins (like ChadNv) so we do it as late as possible
vim.schedule(function()
vim.print("Setting up copilot highlight groups")
for from_group, to_group in pairs(links) do
local ok, existing = pcall(vim.api.nvim_get_hl, 0, { name = from_group })
if not ok or vim.tbl_isempty(existing) then
vim.api.nvim_set_hl(0, from_group, { link = to_group })
end
end
end)
end
return mod