Closed dalgard closed 8 years ago
The problem with this and #56 is that they are conflicting with the official Jade implementation, which is really the focus of this highlighter. The solution would be to add another variant supporting meteor Jade, like the already existing Jade (Python)
, but since I don't use meteor I really have no reason to maintain it. If anyone feels up to the task, just send me a pull request.
Thanks for the quick response.
I realize that the reason for the blue keyword with the following lack of Jade highlighting is that the JavaScript highlighter takes over. The fifth image shows it very clearly. However – even with vanilla Jade syntax alone – I think that control should be given back to the Jade highlighter after the first space following the keyword.
Isn't this correct? I mean, in regard to regular Jade syntax?
The latest updated did mess up the normal Jade syntax too, not just custom one.
Example:
mixin a
a&attributes(attributes)
block
+a()(class='demo-only')
span.hello text
Result on http://jade-lang.com/
Result from jade-tmbundle:
The thing is that it worked well until the last time I restarted ST3, now my files are unreadable :(
I guess setting the syntax to Jade (Python)
fixes this for now.
Sometimes that class
comes from a variable so I can't just use it as .demo-only
You are using the Babel package, right? The problem is that when I pass
the highlighting to another language, I only get the control back when it stops,
and the Babel JavaScript highlighter have rules for some keywords, like class
and type
, that are greedier than Sublime's default.
It's generally not a problem, as code like:
input(type=function placeholder='asdfsdf')
is invalid Jade anyway, but it can cause issues if some features implemented by Babel conflicts with your valid Jade code.
@dalgard I included a special case for mixin call with params in the form name=value
which should solve your use case.
@bfred-it Your example suffered from the same incompatibility with Babel, but I was able to improve the matching for mixins, so now it's more accurate and working as expected.
Yep, that fixed it! Thank you :)
The screenshots below should explain the problem.
(The syntax around
+include
is Meteor-specific, but highlighting works fine there with other words.)