From 02528e8ccbe4d0cef5e1df52eda419c5ed557ad3 Mon Sep 17 00:00:00 2001 From: Jorge Villalobos Date: Mon, 16 Dec 2024 15:21:53 -0500 Subject: [PATCH] fix(tailwind): color rendering (#601) --- lua/blink/cmp/completion/windows/render/tailwind.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/blink/cmp/completion/windows/render/tailwind.lua b/lua/blink/cmp/completion/windows/render/tailwind.lua index 607762bd..0bff6b24 100644 --- a/lua/blink/cmp/completion/windows/render/tailwind.lua +++ b/lua/blink/cmp/completion/windows/render/tailwind.lua @@ -1,10 +1,12 @@ local tailwind = {} +local kinds = require('blink.cmp.types').CompletionItemKind + --- @param item blink.cmp.CompletionItem --- @return string|nil function tailwind.get_hex_color(item) local doc = item.documentation - if item.kind ~= 'Color' or not doc then return end + if item.kind ~= kinds.Color or not doc then return end local content = type(doc) == 'string' and doc or doc.value if content and content:match('^#%x%x%x%x%x%x$') then return content end end