feat: highlight

This commit is contained in:
Barrett Ruth 2026-03-02 20:22:07 -05:00
parent 7a655c9919
commit ba45790910
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

View file

@ -87,11 +87,14 @@ return function()
local buf = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines)
local ns = vim.api.nvim_create_namespace('nonicons_hitest')
for i, name in ipairs(icon_names) do
local hl = highlights.get(name)
local col_start = 2
local col_end = col_start + #icon_glyphs[i]
vim.api.nvim_buf_add_highlight(buf, -1, hl, icon_line_start + i - 1, col_start, col_end)
vim.api.nvim_buf_set_extmark(buf, ns, icon_line_start + i - 1, col_start, {
end_col = col_end,
hl_group = highlights.get(name),
})
end
vim.bo[buf].modifiable = false