vim-css-color icon indicating copy to clipboard operation
vim-css-color copied to clipboard

Potential bug in less files

Open mtscout6 opened this issue 11 years ago • 13 comments

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?

mtscout6 avatar Apr 17 '14 14:04 mtscout6

Hi, thanks for the report and patch. Did 85005760017d78ced358713c29f2911bf74b029a fix this for you?

ap avatar Jun 10 '14 11:06 ap

Sure did, thanks!

mtscout6 avatar Jun 10 '14 13:06 mtscout6

Wait, it partially fixed it. The rgba function still isn't getting colorized. screen shot 2014-06-10 at 7 59 58 am

mtscout6 avatar Jun 10 '14 14:06 mtscout6

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…)

ap avatar Dec 07 '14 19:12 ap

I just updated, but it does not appear to be working still.

mtscout6 avatar Dec 08 '14 16:12 mtscout6

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?

ap avatar Dec 08 '14 18:12 ap

['lessDefinition', 'lessFunction']

mtscout6 avatar Dec 12 '14 17:12 mtscout6

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?

ap avatar Dec 13 '14 07:12 ap

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)?

ap avatar Jul 20 '16 12:07 ap

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.

mtscout6 avatar Jul 20 '16 12:07 mtscout6

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

mtscout6 avatar Jul 20 '16 12:07 mtscout6

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.)

ap avatar Jul 20 '16 14:07 ap

The output is:

['rgba(150, 9, 120, 1)', 'rgba(184, 4, 128, 1)', '#FFFFFF', '#000000', 'rgba(95, 9, 84, 1)']

mtscout6 avatar Jul 20 '16 15:07 mtscout6