Sublime Forum

Goddammit rails syntax!

#1

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?

0 Likes

#2

Add this to your User Keybindings. (Preferences > User Keybindings)

{ "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": "%" ] }

0 Likes

#3

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?

0 Likes

#4

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.

0 Likes