document-color.nvim icon indicating copy to clipboard operation
document-color.nvim copied to clipboard

Colors just flare up briefly and then disappear again

Open stefanwatt opened this issue 2 years ago • 15 comments

Title says it all.

Expected: Background of tailwind color classes stays colorized in the appropriate color.

Actual: Background returns to default background color after a couple ms.

stefanwatt avatar Aug 16 '22 22:08 stefanwatt

that's very strange. do you have any other tailwind colorizer installed?

mrshmllow avatar Aug 16 '22 22:08 mrshmllow

do they come back if you start editing the file

mrshmllow avatar Aug 16 '22 22:08 mrshmllow

that's very strange. do you have any other tailwind colorizer installed?

I don't use multiple in parallel if that's what you mean. I have tried others, tho. With the same result.

do they come back if you start editing the file

Yes, but only if I edit the text of the color class. Not if I just edit anything.

stefanwatt avatar Aug 16 '22 22:08 stefanwatt

I can't reproduce this.. some kind of screen recording or something would help. its probably conflicting with something

mrshmllow avatar Aug 16 '22 22:08 mrshmllow

https://gfycat.com/simpleadmiredbellsnake

stefanwatt avatar Aug 16 '22 22:08 stefanwatt

unfortunately you might just have to go and disable all other plugins until it works

mrshmllow avatar Aug 16 '22 22:08 mrshmllow

Disabled everything except for keymaps and LSP stuff (which obviously I need for tailwind). Issue persists.

stefanwatt avatar Aug 16 '22 22:08 stefanwatt

what version neovim are you using

mrshmllow avatar Aug 16 '22 22:08 mrshmllow

0.7.2

stefanwatt avatar Aug 16 '22 22:08 stefanwatt

try latest git because thats where I tested everything

mrshmllow avatar Aug 16 '22 22:08 mrshmllow

It works fine for me on 0.7.2

mrshmllow avatar Aug 17 '22 06:08 mrshmllow

I encountered something similar, the Tailwindcss LS worked fine, but in .css files with cssls, the colors would show when entering the buffer, but if i moved the cursor around they would disappear.

I found that disabling "xiyaowong/nvim-transparent" fixed the problem for me, i would guess it is something related to opacity or highlight groups

celsobenedetti avatar Aug 18 '22 12:08 celsobenedetti

I don't use that plugin and I already disabled all plugins that aren't absolutely necessary.

stefanwatt avatar Aug 18 '22 21:08 stefanwatt

Okay, i have been able to reproduce this issue. Are you passing

capabilities.textDocument.colorProvider = {
  dynamicRegistration = true
}

to your lsp servers like the readme?

mrshmllow avatar Aug 19 '22 23:08 mrshmllow

@mrshmllow yes, I set colorProvider.dynamicRegistration = true and I can reproduce this issue with tailwindcss LSP, but I don't face this issue when using themaxmarchuk/tailwindcss-colors.nvim

fitrh avatar Nov 16 '22 09:11 fitrh