@@ -9,36 +9,33 @@ local icon_provider, hl_provider
9
9
local function get_kind_icon (CTX )
10
10
-- Evaluate icon provider
11
11
if not icon_provider then
12
- local base = function (ctx ) ctx .kind_icon_highlight = " BlinkCmpKind" .. ctx .kind end
13
12
local _ , mini_icons = pcall (require , " mini.icons" )
14
13
if _G .MiniIcons then
15
14
icon_provider = function (ctx )
16
- base ( ctx )
15
+ local is_specific_color = ctx . kind_hl and ctx . kind_hl : match " ^HexColor " ~= nil
17
16
if ctx .item .source_name == " LSP" then
18
17
local icon , hl = mini_icons .get (" lsp" , ctx .kind or " " )
19
18
if icon then
20
19
ctx .kind_icon = icon
21
- ctx .kind_icon_highlight = hl
20
+ if not is_specific_color then ctx .kind_hl = hl end
22
21
end
23
22
elseif ctx .item .source_name == " Path" then
24
- ctx .kind_icon , ctx .kind_icon_highlight =
25
- mini_icons .get (ctx .kind == " Folder" and " directory" or " file" , ctx .label )
23
+ ctx .kind_icon , ctx .kind_hl = mini_icons .get (ctx .kind == " Folder" and " directory" or " file" , ctx .label )
26
24
end
27
25
end
28
26
end
29
27
if not icon_provider then
30
28
local lspkind_avail , lspkind = pcall (require , " lspkind" )
31
29
if lspkind_avail then
32
30
icon_provider = function (ctx )
33
- base (ctx )
34
31
if ctx .item .source_name == " LSP" then
35
32
local icon = lspkind .symbolic (ctx .kind , { mode = " symbol" })
36
33
if icon then ctx .kind_icon = icon end
37
34
end
38
35
end
39
36
end
40
37
end
41
- if not icon_provider then icon_provider = function (ctx ) base ( ctx ) end end
38
+ if not icon_provider then icon_provider = function () end end
42
39
end
43
40
-- Evaluate highlight provider
44
41
if not hl_provider then
@@ -53,7 +50,7 @@ local function get_kind_icon(CTX)
53
50
local color_item = highlight_colors_avail and highlight_colors .format (doc , { kind = kinds [kinds .Color ] })
54
51
if color_item and color_item .abbr_hl_group then
55
52
if color_item .abbr then ctx .kind_icon = color_item .abbr end
56
- ctx .kind_icon_highlight = color_item .abbr_hl_group
53
+ ctx .kind_hl = color_item .abbr_hl_group
57
54
end
58
55
end
59
56
end
@@ -65,7 +62,7 @@ local function get_kind_icon(CTX)
65
62
icon_provider (CTX )
66
63
hl_provider (CTX )
67
64
-- Return text and highlight information
68
- return { text = CTX .kind_icon .. CTX .icon_gap , highlight = CTX .kind_icon_highlight }
65
+ return { text = CTX .kind_icon .. CTX .icon_gap , highlight = CTX .kind_hl }
69
66
end
70
67
71
68
return {
0 commit comments