Skip to content

Commit 24e690c

Browse files
authored
feat: colorize info panel (#224)
1 parent 048ecbc commit 24e690c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lua/colorbox/controller.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ M.info = function(args)
250250
end
251251
end
252252

253+
local ns = vim.api.nvim_create_namespace("colorbox-info-panel")
253254
vim.api.nvim_buf_set_lines(bufnr, 0, 0, true, {
254255
string.format(
255256
"# ColorSchemes List, total: %d(colors)/%d(plugins), enabled: %d(colors)/%d(plugins)",
@@ -281,6 +282,16 @@ M.info = function(args)
281282
local content = enabled and string.format(" - %s (**enabled**)", color)
282283
or string.format(" - %s (disabled)", color)
283284
vim.api.nvim_buf_set_lines(bufnr, lineno, lineno, true, { content })
285+
286+
-- colorize the enabled colors
287+
if enabled then
288+
vim.api.nvim_buf_set_extmark(bufnr, ns, lineno, 0, {
289+
end_row = lineno,
290+
end_col = string.len(content),
291+
strict = false,
292+
line_hl_group = "Special",
293+
})
294+
end
284295
lineno = lineno + 1
285296
end
286297
end

0 commit comments

Comments
 (0)