[SVN] Revision 1581 (Ruby)

Allan Odgaard allan at macromates.com
Fri Aug 19 03:29:12 UTC 2005


I changed the meta.syntax.ruby.start-block to only match the space after the {, and not the bracket itself (it only verifies it's there using look-behind).

That means to get the smart-typing on |, you'll need at least one space.

I think that's anyway how people write it, right?

The reason for this change is that I've introduced a nest_curly_and_self which matches curly bracket pairs (with ruby code between) which is used for interpolated code in strings, so one can write: $str = "#{ {bar} }" and not have the first } exit the code block.

If it turned out to be desired to have smart-typing on | directly after the opening brace, then we can always merge the two rules.

Come to think about it, the only reason the previous rule was a problem was because it was a longer match than just “{”, so making the nest_curly_and_self also match the optional space afterwards (and not have meta.syntax.ruby.start-block match “}”) would have been another valid solution -- btw: yet another reason to let ordering alone break ties.

Changed:
U   trunk/Bundles/Ruby.tmbundle/Syntaxes/Ruby.plist



More information about the textmate-dev mailing list