slim-template / ruby-slim.tmbundle

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

ST crashes with certain characters at the beginning of a line. #59

Closed bryanrite closed 8 years ago

bryanrite commented 8 years ago

I think the latest update breaks something in the parsing.

For example, I have a file show.js.slim that contains:

| 
  console.log("foo");
  console.log("bar");

This has previously opened fine in ST2 with RubySlim but this morning it would crash ST2. I realized that RubySlim had been updated. If I replace my local RubySlim package's Syntaxes\Ruby Slim.tmLanguage with the one from before 599768b4041cabc0afb1c43ced7dd22f821760ff was merged, everything works fine. The regex change in d16a9aa039f408ab46df4c969e72a39605845781 causes ST to crash when a line starts with a pipe | or a $.

bryanrite commented 8 years ago

It will also crash with a file like:

- if true
  | console.log("foo");
- else
  | console.log("bar");

So the character only has to begin the line to cause the crash.

ghost commented 8 years ago

also breaks on a single quote character.

fredwu commented 8 years ago

Are these caused by #57? If so I'll revert and ping the author. :)

ghost commented 8 years ago

yes, looks like maybe a missing $ sign at end of regex on line 228?

On Thu, Mar 31, 2016 at 6:55 PM, Fred Wu notifications@github.com wrote:

Are these caused by #57 https://github.com/slim-template/ruby-slim.tmbundle/pull/57? If so I'll revert and ping the author. :)

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/slim-template/ruby-slim.tmbundle/issues/59#issuecomment-204163556

Mans Angantyr

Chief Digital Officer

[image: Wasabi Rabbit Logo] http://www.wasabirabbit.com [image: Twitter Logo] https://twitter.com/wasabirabbit [image: LinkedIn Logo] http://www.linkedin.com/company/2228896 [image: Facebook Logo] https://www.facebook.com/wasabirabbit [image: Tumblr Logo] http://vimeo.com/wasabirabbit

T: 646 366 0000 <6463660000> M: 646 491 1814 <0000000000>

19 Fulton Street, Suite 307 New York, NY 10038

fredwu commented 8 years ago

Hi @clthck, re the comments above would you be able to take a look at your recent changes? :)

elquimista commented 8 years ago

I tried with the above code snippet and I don't have such issues. FYI, I'm using ST3. I haven't tested on ST2. Anybody can try with ST2 one more time and confirm the issues?

ghost commented 8 years ago

this breaks on ST2. testing is simple:

  1. open/create a .slim file.
  2. place cursor at beginning of any line.
  3. enter a pipe character.
  4. watch editor crash
solisoft commented 8 years ago

on ST2 It also crash on $(function() {}) and press enter when the cursor is between {}

javascript:
  $(function() {})
elquimista commented 8 years ago

Why don't you just use ST3? Is there any specific reason for not upgrading? ST3 is still in beta phase, but it's almost stable. If you still need to stick to ST2, then we'd better revert the commit. I'm not planning to make it compatible with ST2 for now.

solisoft commented 8 years ago

maybe because I have a licence for ST2 and not ST3

ghost commented 8 years ago

are there any plans to either fix or reverting this commit? it's not clear from this thread. it's a bad bug, which crashes the app, and is virtually impossible to avoid triggering. everybody on our team has disabled the plugin as of last week. but we love it, and would love install it again. thoughts?

mocerinoj commented 8 years ago

-

sbleon commented 8 years ago

Please revert this fix. Thanks!

fredwu commented 8 years ago

Commit reverted.

sbleon commented 8 years ago

Thanks, @fredwu ! The package works again in ST2 after a Package Control: Upgrade Package.