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 }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Line, which starts from "elif" or "else" moves one indent level left #209
Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
When line starts from "elif" or "else" keyword, has some indentation (I use tabs), before it already used "return" statement and you add something to it, then it automatically moves to one indent level left.
Steps to Reproduce
Maybe to check preferences to be consistent with myne. Also to use tab key (and tabs) for indentation.
Make some block with indentation
Add line with "if" on it; and it's block
2.5. Include "return" statement into "if" block (or "elif" block, which is previous to that, which will be unindented).
Add line with "elif" or "else" and something into it.
After you'll press ":", than this line will be moved to one indentation level left.
After this if you'll move this line to one indentation right - it'll be moved
If you'll try to change something on this line - it'll be moved to one indentation level left again.
Expected behavior: Nothing would be moved to one indentation level left. Because functions often have several "return" statements. Actual behavior: Line is moved to one indentation level left
Place cursor on Line 4, anywhere after the 9th character (inside the condition of the line beginning with elif)
Begin editing the conditional statement
Expected behavior: I would expect the line to stay stationary as I add new content in the middle of it.
Actual behavior: The indentation of line 4 shifts to the left
Reproduces how often: Always
Versions
On Mac OSX (10.12.6)
Atom : 1.20.1
Electron: 1.6.9
Chrome : 56.0.2924.87
Node : 7.4.0
Additional Information
You can find many similar variations of this issue. For example, in step 3-4 above, instead simply highlight elif and type else in its place. The indentation will shift the same way.
I'm having this exact same problem. Upon finishing the line of an elif or else statement with a colon, that line unindents itself. This seems to have been an issue for quite some time, how come it's still a problem? Is it a mysterious or difficult problem to solve?
Thanks to 50Wliu's pull request #212, this is now somewhat fixed in language-python release 0.45.5, which appears to be included in core Atom release 1.23.0-beta1. If you want to get this fix, you can manually install 1.23.0-beta1 and it will be fixed! (I have tested this; it was fixed in 1.23.0-beta1 but not in 1.22.0.)
Activity
lumbduck commentedon Sep 28, 2017
I've had this problem as well. The unwanted shifting of the indent happens in several situations while editing
elseandelifstatements.I made sure that all issue-tracking prerequisites were met. One simple example follows.
Steps to Reproduce
atom --safewith default configuration (I moved my configuration to a backup)Atom_indent_issue.py.zip
elif)Expected behavior: I would expect the line to stay stationary as I add new content in the middle of it.
Actual behavior: The indentation of line 4 shifts to the left
Reproduces how often: Always
Versions
On Mac OSX (10.12.6)
Atom : 1.20.1
Electron: 1.6.9
Chrome : 56.0.2924.87
Node : 7.4.0
Additional Information
You can find many similar variations of this issue. For example, in step 3-4 above, instead simply highlight
elifand typeelsein its place. The indentation will shift the same way.csvoss commentedon Sep 28, 2017
This issue is happening to me as well. It seems to happen when my
eliforelseis directly after areturnorpassin the previous block.Hanzhizheng commentedon Oct 9, 2017
same issue
eicksl commentedon Oct 14, 2017
I've also been experiencing this issue, both before and after the new 1.21.1 update.
Jglez2330 commentedon Oct 15, 2017
same problem
Navigat-r commentedon Nov 28, 2017
I'm having this exact same problem. Upon finishing the line of an elif or else statement with a colon, that line unindents itself. This seems to have been an issue for quite some time, how come it's still a problem? Is it a mysterious or difficult problem to solve?
csvoss commentedon Nov 28, 2017
Thanks to 50Wliu's pull request #212, this is now somewhat fixed in language-python release 0.45.5, which appears to be included in core Atom release 1.23.0-beta1. If you want to get this fix, you can manually install 1.23.0-beta1 and it will be fixed! (I have tested this; it was fixed in 1.23.0-beta1 but not in 1.22.0.)
Navigat-r commentedon Nov 28, 2017
I tried it out, updating to the beta, and it seems indeed like it works! Thanks for the tip! :)