textmate / ruby-haml.tmbundle

TextMate support for Ruby Haml
75 stars 14 forks source link

Ruby code spanning multiple lines is not highlighted #9

Open jacob-carlborg opened 11 years ago

jacob-carlborg commented 11 years ago
= func foo: 1,
  bar: 2

In Textmate the above example is not highlighted correctly, only the first line is highlighted.

korny commented 10 years ago

I think I have a fix for this. The rubyline end must be changed to:

end = '((do|\{)( \|[^|]+\|)?)$|(?<!,)\n';

Works for lines ending in a comma, which covers at least 90% of our cases. Unfortunately, this breaks the | continuation syntax, but we never use this. I just don't understand how TextMate handles $ in end patterns. It's weird.

I will test it for a few days, and try to make a pull request.