diff options
author | Akianonymus <anonymus.aki@gmail.com> | 2022-09-07 11:26:59 +0530 |
---|---|---|
committer | Akianonymus <anonymus.aki@gmail.com> | 2022-09-07 12:15:21 +0530 |
commit | 125e4995b86a94405aaf40191738f4b6fcd8ed57 (patch) | |
tree | 204312ca1da268a3eaa96e45b6f1f9ec9c580341 /lua/colorizer/buffer_utils.lua | |
parent | buffer_utils: Validate rgb_hex too | trie: Add exact param to longest_prefix (diff) |
tailwind: Use true for normal mode
For first start, wait 100 ms before trying to get some info from the lsp
Diffstat (limited to 'lua/colorizer/buffer_utils.lua')
-rw-r--r-- | lua/colorizer/buffer_utils.lua | 5 |
1 files changed, 4 insertions, 1 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 |