[TxMt] folding patterns and comments

Jeroen van der Ham jeroen at je-ju.net
Mon Jan 9 10:47:52 UTC 2006


Michael Sheets wrote:
>>     foldingStartMarker =
>> '\b(proc|domain|case|if|%if|for|while|repeat|axiom|category)\b';
>>     foldingStopMarker =
>> '\b(end|end_proc|end_domain|end_case|end_if|end_for|end_while|end_repeat|end_axiom|end_category)\b'; 
>>
> 
> You could do for instance...
> 
> '[^#]*?\b(proc|domain|case|if|%if|for|while|repeat|axiom|category)\b'
> 

That would work, but it seems to me that you really want:

'^\s*\b(proc|domain|case|if|%if|for|while|repeat|axiom|category)\b'


So that if it is the first word on a line (possibly preceded by 
whitespace), it is a fold start.

Jeroen.



More information about the textmate mailing list