On 25 Aug 2020, at 14:34, Per Persson via TextMate wrote:

Hi,

I have noticed a weird behavior with indentation that I'm pretty sure hasn't always been present (as it would have driven me nuts). I've only seen this with python files, and since I keep my own python3 bundle I removed that and installed the default python bundle with the same results.

Let me try to illustrate.

Using the settings

increaseIndentPattern = '^\s*(class|((async\s+)?(def|with|for))|elif|else|except|finally|if|try|while)\b.*:\s*$|(\{|\[)\s*$';
decreaseIndentPattern = '^\s*(elif|else|except|finally)\b.*:|^\s*(\}|\])';
disableIndentCorrections = :true;
indentOnPaste = 'simple';

I forget the details of the behavior I didn’t like before, but I use

disableIndentCorrections = 'emptyLines'

Give that a try. Python is my primary language and it mostly does what I want. The exceptions:

It doesn’t auto-indent after (, but that’s probably the language grammar.

After a block like

class MyClass:
    def action(self):
        pass


Hitting ⇥ at the location shown above will line up with pass and not the previous def. I guess it’s doing the thing that makes sense, even though it’s never what I want and bites me almost daily.

--
Rob McBroom