Open cj opened 5 years ago
Incase anyone else has run into this, my current hack is:
syn region styledDefinition start=/css`/ skip=+\\`+ end=+`+ containedin=ALL contained transparent fold extend
\ contains=@CSSTop,
\ css.*Prop,cssValue.*,cssColor,cssUrl,cssImportant,cssError,
\ cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,
\ cssHacks,
\ cssCustom.*,
\ jsComment,jsTemplateExpression,
\ typescriptInterpolation,typescriptTemplateSubstitution,
\ styledAmpersand,styledNestedRegion
Hello @cj
please make sure to provide a minimal vimrc that allows me to reproduce the above mentioned highlighting. Otherwise I don't know how to help you.
@fleischie Sorry about that, here you go https://gist.github.com/cj/95337089bbc241407e7ae94e725e3ff0
If you need anything else let me know!
@cj I think I found the issue, either I never bothered to add support or it may have changed but the issue you were referring to was specifically a HerringtonDarkholme/yats.vim related issue.
This plugin registers tagged templates with a different name than the plugins that I used, so it was just a matter of time until it didn't work properly for someone's setup.
Anyway, I pushed a commit, that should allow highlighting of the mentioned css
tagged template for you to test out. :+1:
And if you're at it, I would really appreciate you going through the other example files in the ./examples
folder and see, whether something else is missing/broken. So maybe I need to add more support to more custom syntax names. Thanks in advance. 🙏
@fleischie thank you! I really appreciate it!
Here are some broken things I found going through the examples:
examples/issue-30-1.js:
examples/issue-30-2:
examples/issue-32:
There was also one issue I found that was not included in your examples:
examples/issue-44:
One other thing I noticed is the indenting is off:
@cj I really do appreciate you taking the time to investiage all of this. If I find the time I will address these.
Hey @cj
I am kind of embarrassed to admit that I forgot to investigate this because I never took the time...
Using the vimrc you provided and looking at the files you mentioned, I wasn't really able to reproduce the shown misconfigurations. (Some are necessary, though, for example -top
, -right
, etc. is not easy to highlight correctly because of how regexp works in vim).
Let me know, if you still have the above mentioned issues and maybe my setup guards me from the seen behaviors/highlights....
Just wanted to throw in that I'm having this issue, too.
With a function:
Without a function (which works):
It appears to not be highlighting inside of functions i.e.:
Or when cast to a variable:
This is it working when it's not inside or function or being cast to a variable: