On August 25, 2020 at 9:13 PM, "Rob McBroom" <mailinglist0@skurfer.com> wrote:

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.

Thanks, that did the trick! This behaviour should probably be the default for python.

The exceptions:

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

I though it would be just a matter of adding ( and ) to increase/decrease indent patterns, but that doesn't seem to have any effect whatsoever. In fact, removing the part of the increase/decrease indent pattern regexes matching [{ and }] doesn't change the current behaviour, so it seems that it is handled differently. Googling, I found a thread that suggests that auto-indent of paired [] and {} is based a macro triggered by the return key when in a certain scope: 
(about half-way down the conversation)

I say we need some authoritative advice here ;)


After a block like

class MyClass:
    def action(self):

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.

Yeah, I agree.  A bit ugly workaround is to add a snippet that applies when caret is in the leftmost position, e.g.:
`printf "%*s" ${TM_TAB_SIZE} ''`$0

and setting the scope selector to L:(source.python dyn.caret.begin.line) and key equivalent to ⇥.
This would obviously only work if you use spaces for tabs...