Unexpected Auto-indent behavior in Python


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.


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


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):

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