Skip to content

Commit f3701bc

Browse files
committed
fix(blink-cmp): only check for highlight colors if there is documentation to check
1 parent 84dbfa0 commit f3701bc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lua/astrocommunity/completion/blink-cmp/init.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ local icon_provider = false
1919
local function get_icon(ctx)
2020
ctx.kind_hl_group = "BlinkCmpKind" .. ctx.kind
2121
if ctx.item.source_name == "LSP" then
22-
local highlight_colors_avail, highlight_colors = pcall(require, "nvim-highlight-colors")
23-
local color_item = highlight_colors_avail and highlight_colors.format(ctx.item.documentation, { kind = ctx.kind })
22+
local item_doc, color_item = ctx.item.documentation, nil
23+
if item_doc then
24+
local highlight_colors_avail, highlight_colors = pcall(require, "nvim-highlight-colors")
25+
color_item = highlight_colors_avail and highlight_colors.format(item_doc, { kind = ctx.kind })
26+
end
2427
if icon_provider == false then icon_provider = get_icon_provider() end
2528
if icon_provider then
2629
local icon = icon_provider(ctx.kind)

0 commit comments

Comments
 (0)