Closed mb720 closed 4 years ago
The plugin already tries to prevent that from happening. It calculates the brightness of the colour and sets the text colour to black if the colour is light, or white if the colour is dark. That’s what all the variables with “bright” in their name are for.
Does Vim consider your terminal a 256-colour terminal? Because in that case the plugin uses colour 0 for black and colour 15… but of course those indices could be anything. If you’re defining a custom background and foreground colour it could be that the terminal emulator is putting them in those spots in the palette. OTOH, the rectangle on the screenshot is pure #000000
, no trace of #204040
, so that doesn’t seem right either. I don’t know what’s going on exactly.
Does Vim consider your terminal a 256-colour terminal?
I'm not sure. echo $TERM
gives xterm-kitty
. If I do export TERM=xterm-256color;
before opening the file, it doesn't seem to have an effect.
I just tested with Konsole and Alacritty again and can see that the dark colors are highlighted properly. But when I scroll down to the CSS rule mentioned above, all syntax highlighting is lost, in all terminal emulators. When I scroll back up, everything's fine in Konsole and Alacritty, but in Kitty, I see those black bars instead of color names. Seems like an issue with Kitty.
It also might be, that I'm observing two unrelated phenomena.
I'm closing this for now since in the majority of tested terminal emulators it works.
Why closed…?
Because I don't think the issue lies with the plugin, but rather with Kitty. I can reopen if you want.
Ah. That’s fine then.
Hi and thanks a lot for this plugin!
If the color name "black" occurs in a CSS file, I can't read it anymore since it's become a black stripe.
For example, I have this rule in a CSS file:
On my machine, this looks like something the CIA released ;-)
I'm using Neovim inside Kitty as the terminal emulator.
I have this in my
kitty.conf
:While I was scrolling through the file, the colors suddenly worked:
This lasted only a briefly. After scrolling to the top of the file and back down to this CSS rule, the color names were illegible again.
Please let me know how to debug this.
I tested it with a different terminal emulator, Konsole, seeing the same results.