Unexpected Auto-indent behavior in Python


#1

When I try to edit say an if statement, the line that I am trying to edit indents to the left for some reason. I have tried reinstalling Atom but this behavior still persists. Is anyone getting this problem and does anyone know how to fix it? Thanks.


#2

I can’t quite visualize the behavior you’re talking about. Maybe pictures or a gif would help.


#3

Could it be that you’re starting the line at an indent beyond what the python package expects?

For example:

while fred == barney:
    if wilma.likes(betty):
        do_something()

It would make sense, if your tab setting is for 2 spaces, for the editor to move the if statement back 2 to match.