You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Indentation level of else:-type lines is not reduced #771
Python Extension version: 2018.1.0
Python Version: 3.6.3
OS and version: Ubuntu 2017.10 AMD64
Actual behavior
After typing enter at the end of a line such as else:, elif cond:, except:, finally:, the indentation level of that line is unchanged and the next line is auto-indented to the wrong level as well:
if cond:
do_stuff()
else:|
after typing enter, becomes
if cond:
do_stuff()
else:
|
Expected behavior
if cond:
do_stuff()
else:|
after typing enter (or : on atom if I remember correctly), should become
if cond:
do_stuff()
else:
|
Steps to reproduce:
Use a construct as if-elif-else, try-except-else-finally.
Is this normal? I expect that this is a problem with my setup and not this extension given the simplicity of the issue, but my install is as standard as can be...
Activity
MikhailArkhipov commentedon Feb 20, 2018
The caret is placed correctly, one level less than
else:. Movingelserequires AST/autoformatting infrastructure.nathdwek commentedon Feb 21, 2018
OK, good to know this is currently expected behaviour.
Thank you for trying to tackle this!
AlexChapple commentedon Jul 8, 2018
Is there an update on this?
brettcannon commentedon Jul 11, 2018
[ @redoctopus0 I edited your ✉️ ⬆️ to come off as more 😃 and less 😠 ]
Fixing this requires #1847 which is not a minor undertaking. So we expect to get to it eventually, but it might be a little while.
brettcannon commentedon Oct 17, 2018
Was supposed to be fixed by #2724 .
luabud commentedon Mar 15, 2019
tracked by #481