slim-template / ruby-slim.tmbundle

A Textmate / Sublime Text bundle for Slim
http://slim-lang.com/
MIT License
184 stars 46 forks source link

First line after `do` gets styled as ruby #53

Closed halloffame closed 8 years ago

halloffame commented 9 years ago

This relates to this issue https://github.com/slim-template/language-slim/issues/7

The first line after do is getting interpreted as ruby, not slim. I think this just started recently, I haven't noticed it before.

screen shot 2015-01-29 at 11 21 26 am

flexbox commented 9 years ago

Ahhh i have the same issue here.

halloffame commented 9 years ago

You can fix it temporarily by removing the |\n that was added on this line https://github.com/slim-template/ruby-slim.tmbundle/pull/49/files#diff-c53c9767616c99387c87d68b79179e97L579

skunkworker commented 9 years ago

I ran into this same issue tonight.

kreintjes commented 9 years ago

Same problem over here

mikemerritt commented 8 years ago

This is still a problem and is quite annoying.

tijn commented 8 years ago

It totally is broken but I learned an easy way to avoid the issue.

It seems that do in slim is only needed when you want to use block arguments. If you don't, you may omit it. I think the code that handles the indentation implicitly puts the do back when it converts the template to code.

So the following snippet should be valid slim and also correctly highlighted in Sublime Text:

= content_for :header
  p the first line
  p the second line
kreintjes commented 8 years ago

Problem was fixed with https://github.com/slim-template/ruby-slim.tmbundle/pull/62, but seems to be back after updating to Sublime Text 3 to build 3126. @tshedor any chance you could take a look at this?

tshedor commented 8 years ago

@kreintjes I can confirm that the highlighting is broken again (using ST3 build 3126), but I'm going to hold off on debugging until ST3 is at the official release OR early November, whatever comes first. It seems like he's finally close to the official release, and I don't want to chase a bug that will eventually be patched. Are you able to get by with removing the do?

kreintjes commented 8 years ago

@tshedor Sure, no problem. Thanks for the reply!

tshedor commented 7 years ago

@kreintjes I'm going to use #72 as a reference for this instead since that's a clean issue