[TxMt] folding comment blocks

Gavin Kistner gavin at refinery.com
Wed Oct 5 13:55:58 UTC 2005


On Oct 5, 2005, at 7:19 AM, David Jack Olrik wrote:
> On 04/10/2005, at 23.26, Allan Odgaard wrote:
>
>> Which would be foldable by using these patterns:
>>     foldingStartMarker = '#\+';
>>     foldingStopMarker = '#-';

Out of curiosity, why doesn't this work (latest version of TextMate):

     foldingStartMarker = '^\s*#.+\n(?=\s*#)';
     foldingStopMarker  = '^\s*#.+\n(?!\s*#)';

The regexp work in the Find dialog, finding the desired lines.
If it did, I should get folding starts on all lines of a multi-line  
comment save for the last; as it is, I don't get any folding markers  
at all using those regexp on the following document:

module Foo #Just a single-line
     # Another lone single-line - no need to fold
     def foo

     end

     # Here's more than one line comment
     # carried on and on
     # until the end
     def bar

     end
end






More information about the textmate mailing list