I’m having an issue with indentation. I’ve noticed that if my caret is at the end of this blob of code…
def foo(index):
if index < 0:
return 'something'
return 'other thing'
…and I press return, the indentation levels stays the same at the next line, at the level of if, instead of moving back to the level of def.
Are there cases where this behavior is “desirable” or “correct”? Or is this some kind of bug/oversight?
It’s a bit annoying because the python linter wants me to put two line breaks before each new python function, and I can’t just do “return return” after finishing the previous function, I have to do “return backspace return”. (And more likely “return-return-oh-crap-I-still-have-whitespace-here-backspace-backspace-backspace-return”.)
A similar issue arises with the break statement: the next line stays at the same indendentation level, instead of going back (at least one) indentation level which, it seems to me, would be the smart behavior.