icons and highlights for cmdline

This commit is contained in:
Oliver Hartmann 2025-03-02 23:01:58 +01:00
parent 8020b6efc9
commit 89c5cdb7f5

View File

@ -158,7 +158,9 @@ return {
text = function(ctx)
local lspkind = require('lspkind')
local icon = ctx.kind_icon
if vim.tbl_contains({ 'Path' }, ctx.source_name) then
if ctx.source_name == 'cmdline_history' then
icon = require('nvim-web-devicons').get_icon('log')
elseif vim.tbl_contains({ 'Path' }, ctx.source_name) then
local dev_icon, _ = require('nvim-web-devicons').get_icon(ctx.label)
if dev_icon then
icon = dev_icon
@ -177,7 +179,11 @@ return {
-- keep the highlight groups in sync with the icons.
highlight = function(ctx)
local hl = ctx.kind_hl
if vim.tbl_contains({ 'Path' }, ctx.source_name) then
if ctx.source_name == 'cmdline_history' then
_, hl = require('nvim-web-devicons').get_icon('log')
elseif ctx.source_name == 'cmdline' then
_, hl = require('nvim-web-devicons').get_icon('cc')
elseif vim.tbl_contains({ 'Path' }, ctx.source_name) then
local dev_icon, dev_hl = require('nvim-web-devicons').get_icon(ctx.label)
if dev_icon then
hl = dev_hl