aboutsummaryrefslogtreecommitdiff
path: root/lua/colorizer
diff options
context:
space:
mode:
Diffstat (limited to 'lua/colorizer')
-rw-r--r--lua/colorizer/buffer_utils.lua5
-rw-r--r--lua/colorizer/color_utils.lua2
-rw-r--r--lua/colorizer/matcher_utils.lua2
3 files changed, 6 insertions, 3 deletions
diff --git a/lua/colorizer/buffer_utils.lua b/lua/colorizer/buffer_utils.lua
index 498804b..6feaadb 100644
--- a/lua/colorizer/buffer_utils.lua
+++ b/lua/colorizer/buffer_utils.lua
@@ -188,7 +188,10 @@ function highlight_buffer(buf, ns, lines, line_start, options, options_local)
local ok, client = pcall(vim.lsp.get_client_by_id, args.data.client_id)
if ok then
if client.name == "tailwindcss" and client.supports_method "textDocument/documentColor" then
- highlight_buffer_tailwind(buf, DEFAULT_NAMESPACE_TAILWIND, mode, options)
+ -- wait 100 ms for the first request
+ vim.defer_fn(function()
+ highlight_buffer_tailwind(buf, DEFAULT_NAMESPACE_TAILWIND, mode, options)
+ end, 100)
TW_LSP_ATTACHED[buf] = true
end
end
diff --git a/lua/colorizer/color_utils.lua b/lua/colorizer/color_utils.lua
index b90c108..34a04f5 100644
--- a/lua/colorizer/color_utils.lua
+++ b/lua/colorizer/color_utils.lua
@@ -86,7 +86,7 @@ local function color_name_parser(line, i, opts)
end
end
if opts and opts.tailwind then
- if opts.tailwind == "normal" or opts.tailwind == "both" then
+ if opts.tailwind == true or opts.tailwind == "normal" or opts.tailwind == "both" then
local tailwind = require "colorizer.tailwind_colors"
-- setup tailwind colors
for k, v in pairs(tailwind.colors) do
diff --git a/lua/colorizer/matcher_utils.lua b/lua/colorizer/matcher_utils.lua
index 11e56f6..29cd5e9 100644
--- a/lua/colorizer/matcher_utils.lua
+++ b/lua/colorizer/matcher_utils.lua
@@ -71,7 +71,7 @@ local function make_matcher(options)
+ (enable_AARRGGBB and 1 or 4)
+ (enable_rgb and 1 or 5)
+ (enable_hsl and 1 or 6)
- + (enable_tailwind == "normal" and 1 or 7)
+ + ((enable_tailwind == true or enable_tailwind == "normal") and 1 or 7)
+ (enable_tailwind == "lsp" and 1 or 8)
+ (enable_tailwind == "both" and 1 or 9)