I'm a little behind the times and just noticed Textmate 2 exists—I've been using 1.5.10 for years.
I'm trying it out, and in some ways the code folding for Python is improved. (It no longer eats a line of whitespace after collapsed method/class definitions). However, it no longer folds lists, tuples, and dictionaries that are split onto multiple lines. The following code, for example, has folding arrows in 1.5.10 but not in 2.0.6:
foo = [
1,
2,
3,
]
The default Folding setting in the Python bundle is:
{ foldingStartMarker = '^\s*"""(?=.)(?!.*""")';
foldingStopMarker = '^\s*"""\s*$';
}
And the default Folding Patterns reads:
{ foldingIndentedBlockStart = '^\s*(class|def|for|while|if|elif|else|with|try|finally|except)\b.*:\s*(#.*)?$'; }
I'm not entirely sure how these two work together, especially since the only documentation I can find for folding definitions is for TextMate 1.5 and appears outdated. I've tried fiddling with them, so far to no avail. Does anyone have any ideas?