vim-css-color
vim-css-color copied to clipboard
Potential bug in less files
I don't know if this was intentional or not, but when I have a color on something other than a variable I do not see any color highlighting. I added a test for to highlight what I'm seeing here. Was this intentional if not what would I need to do to get that working?
Hi, thanks for the report and patch. Did 85005760017d78ced358713c29f2911bf74b029a fix this for you?
Sure did, thanks!
Wait, it partially fixed it. The rgba function still isn't getting colorized.

This has to be fixed now after 353a6a8e4c… right?
(Errm, you’ll have to manually add an rgba() unit in that place I guess, since I made all test files the same. Maybe I should have examples of every combination in every place after all…)
I just updated, but it does not appear to be working still.
Argh!
Hrmf. Can you put the cursor somewhere within that rgba() value and do
:echo map(synstack(line("."), col(".")), "synIDattr(v:val, 'name')")
and tell me what that says?
['lessDefinition', 'lessFunction']
Hrm OK… lessDefinition is part of the syntax group and should be getting highlighted.
Does the output of :echo keys(b:has_pattern_syn) include that particular rgba() value?
Hmm, this bug stalled a long time ago.
@mtscout6: did the issue go away or did you just no longer care for some other reason (stopped using the plugin, or Vim, or whatever)?
Still using the plugin, moved into a management position though so I haven't been in the weeds for a while. Unless anything has changed I'd imagine the problem still exists.
In response to your question I missed years ago:
Source:
@farge-sochi-lys: rgba(184, 4, 128, 1);
@farge-sochi: rgba(150, 9, 120, 1);
@farge-sochi-mork: rgba(95, 9, 84, 1);
@farge-tekst: white;
@hex-white: #FFFFFF;
@hex-black: #000000;
p {
background-color: #FFFFFF;
background-color: rgba(184, 4, 128, 1);
}
With my cursor over the rgba inside the p selector.
:echo keys(b:has_pattern_syn)
E121: Undefined variable: b:has_pattern_syn
E116: Invalid arguments for function keys(b:has_pattern_syn)
E15: Invalid expression: keys(b:has_pattern_syn)
Press ENTER or type command to continue
Oh, I overlooked that I renamed variable in the time since I wrote that comment. Can you try this again with echo keys(b:css_color_syn)? (Doesn’t matter where the cursor is, btw, for that.)
The output is:
['rgba(150, 9, 120, 1)', 'rgba(184, 4, 128, 1)', '#FFFFFF', '#000000', 'rgba(95, 9, 84, 1)']