Home Download Buy Blog Forum Support

Goddammit rails syntax!!!

Goddammit rails syntax!!!

Postby sloloo on Fri Jan 20, 2012 8:47 pm

How to fix shit with <%= (<%) and not closing them %> tag? Just said you doing it on purpose so that only full payed version will be with normal syntax?
sloloo
 
Posts: 4
Joined: Wed Jan 11, 2012 4:48 am

Re: Goddammit rails syntax!!!

Postby C0D312 on Fri Jan 20, 2012 9:06 pm

Add this to your User Keybindings. (Preferences > User Keybindings)
Code: Select all
  {
       "args": {
         "contents": "% $0 %>"
       },
       "command": "insert_snippet",
       "context": [
         {
           "key": "selector",
           "match_all": true,
           "operand": "source.ruby",
           "operator": "equal"
         },
         { "key": "preceding_text", "operator": "regex_match", "operand": ".*<", "match_all": true }
       ],
       "keys": [
         "%"
       ]
   }
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Goddammit rails syntax!!!

Postby DanyW on Mon Jan 23, 2012 12:37 am

I have added this... but not sure how it's supposed to work. I typed "<%" in an erb file, and expected it to complete the matching "%>" but it's not happening. What's this snippet supposed to do?
DanyW
 
Posts: 8
Joined: Sat Jan 21, 2012 11:02 pm

Re: Goddammit rails syntax!!!

Postby C0D312 on Mon Jan 23, 2012 1:35 am

DanyW wrote:I have added this... but not sure how it's supposed to work. I typed "<%" in an erb file, and expected it to complete the matching "%>" but it's not happening. What's this snippet supposed to do?


I don't use ruby but your problem may have to do with scope. Press option-shift-p to see the current scope in the status bar. For this snippet to work, the scope of the snippet has to match the scope shown in the status bar. For example, in a ruby file, the scope is source.ruby. So the snippet will trigger. This can be changed as needed.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am


Return to Technical Support

Who is online

Users browsing this forum: Gary King, Google [Bot] and 10 guests