Execute Selection in Console Won't Ignore Leading Whitespace
Answered
I just updated PyCharm Community to version 2016.3.2 (I don't know what version I was using before the update... embarrassing).
Before updating I used to be able to do the following:
In the editor write
def foo():
x=1
return 0
and then highlight the line containing x=1 and do "Execute Selection in Console" (shortcut "Alt+ Shift + e"). For highlighted single lines and blocks of code it seemed to strip the correct amount of whitespace so that the console would not see that the code came out of an indented blog in the editor.
Now when I try the same thing the console is unhappy and I receive "IndentationError: unexpected indent".
For obvious reasons this is incredibly annoying :) Thanks in advance!
Please sign in to leave a comment.
Hello, thank you for the report!
There are several issues: https://youtrack.jetbrains.com/issue/PY-21653 and https://youtrack.jetbrains.com/issue/PY-21991 fixed in PyCharm 2016.3.1 and PyCharm 2017.1 EAP https://www.jetbrains.com/pycharm/nextversion/ respectively. Please, check PyCharm 2017.1 EAP and let me know if it doesn't fix the problem.