[TextMate] Re: Ruby syntax coloring glitch

Allan Odgaard allan at macromates.com
Thu Oct 14 12:00:18 UTC 2004


On 14. Oct 2004, at 13:19, John Labovitz wrote:

> This is easy to fix, if you want to edit your .plist file.  I copied 
> the stock Ruby bundle and modified Ruby.tmbundle/Syntaxes/Ruby.plist 
> so that the "foldingStartMarker" key has the following value:
>
> 	^\s*(class|module|def)\>

You may want it to be (showing double escapes here):

    ^\\s*(class|module|def)\\>(?!.*\\<end\\>)";

The (?!...) part is a negative look-ahead assertion and means, that the 
keywords shouldn't be followed by the pattern (which here is just 
.*end). So for example a line that has: "def method ... end" will not 
appear as a fold start marker.


Kind regards Allan




More information about the textmate mailing list