As shown below:

TextMate's Python mode can't detect the end of a Python function. As a result, the folding/unfolding action isn't working for Python code.
Is this a bug of the Python bundle? If so, are there any patches to resolve this issue?
|
feedback
|
|
You have to make sure you undent the blank line between the function definitions, otherwise the language grammar will have trouble picking out the end of the function. It's not really a bug, just a limitation of TextMate's grammar engine and the fact that Python uses indentation to delineate blocks. | |||
|
feedback
|
|
further to mipadi's answer, if you have the textmate python bundle installed, you can select-all and use the "Cleanup Whitespace" command to automagically fix up most of the indentations in existing code so that the folding engine can find blocks. | ||||
|
feedback
|