Skip to content

Commit

Permalink
fix(blink-cmp): only check for highlight colors if there is documenta…
Browse files Browse the repository at this point in the history
…tion to check
  • Loading branch information
mehalter committed Dec 23, 2024
1 parent 84dbfa0 commit f3701bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/astrocommunity/completion/blink-cmp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ local icon_provider = false
local function get_icon(ctx)
ctx.kind_hl_group = "BlinkCmpKind" .. ctx.kind
if ctx.item.source_name == "LSP" then
local highlight_colors_avail, highlight_colors = pcall(require, "nvim-highlight-colors")
local color_item = highlight_colors_avail and highlight_colors.format(ctx.item.documentation, { kind = ctx.kind })
local item_doc, color_item = ctx.item.documentation, nil
if item_doc then
local highlight_colors_avail, highlight_colors = pcall(require, "nvim-highlight-colors")
color_item = highlight_colors_avail and highlight_colors.format(item_doc, { kind = ctx.kind })
end
if icon_provider == false then icon_provider = get_icon_provider() end
if icon_provider then
local icon = icon_provider(ctx.kind)
Expand Down

0 comments on commit f3701bc

Please sign in to comment.