0

I'm working on a big project so I use code folding a lot. I basically have two types of code:

1.

help.scroll = function() {
    // some code
}

2.

help.scroll = {
    // some code
};

So Textmate folds the first code, but doesn't folds the second one.

The original folding start marker looks like this

foldingStartMarker = '^.*\bfunction\s*(\w+\s*)?\([^\)]*\)(\s*\{[^\}]*)?\s*$';

I guess ending marker is ok as is

foldingStopMarker = '^\s*\}';

So my question is - How do I modify "foldingStartMarker" so that Textmate will fold both blocks of code.

thx in advance

ajitam
  • 371
  • 3
  • 16

1 Answers1

0

Having no idea about your textmate version, but the following may work as in textmate 2.0(9283):

{   foldingStartMarker = '\{\s*(//.*)?$|\[\s*(//.*)?$|\(\s*(//.*)?$';
    foldingStopMarker = '^\s*\}|^\s*\]|^\s*\)';
}
ZhangChn
  • 3,154
  • 21
  • 41