coffee-script-tmbundle icon indicating copy to clipboard operation
coffee-script-tmbundle copied to clipboard

Syntax highlighting broken for division operator; thinks a regex has started.

Open steveluscher opened this issue 11 years ago • 2 comments

I don't know if this is the right place to do this. The TM2 bundle repository doesn't have an issue tracker attached to it.

From Bartłomiej Kubiak on the Textmate mailing list:

CoffeeScript bundle has broken syntax highlighting 
when using division operator ("/") - badly interprets it 
as start of regexp…

Syntax highlighting broken with the division operator - example

This might be the culprit.

steveluscher avatar Mar 20 '13 18:03 steveluscher

The way we solve this in the ruby grammar is a look-behind that checks to see if the preceding characters are indicative of starting a regular expression match. This may be possible with Coffeescript as well but would take someone better versed in the language than I.

infininight avatar Mar 27 '13 23:03 infininight

I have the same problem, I found that the highlighting is only broken when the / division sign is attached to the following string without any space.

i.e. this breaks the highlighting return multiples/quantities this doesn't return multiples/ quantities

DonGiulio avatar Oct 31 '13 08:10 DonGiulio