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 has been archived by the owner on Dec 15, 2022. It is now read-only.
A multiline function call causes Atom's autoindenter to perform unexpectedly, adding an extra layer to indentation from that call down.
Steps to Reproduce
In Atom, create a new Javascript file.
Write or paste code like the following:
if(myBoolean) {
var result = MyObject.thisIsAVeryLongFunctionNameWithParameters(firstParam,
secondParam, thirdParam, fourthParam, fifthParam);
}
Select All.
Auto-indent.
Expected behavior:
Code formatted like this:
if(myBoolean) {
var result = MyObject.thisIsAVeryLongFunctionNameWithParameters(firstParam,
secondParam, thirdParam, fourthParam, fifthParam);
}
Note that the close curly brace for the if is aligned with the if statement.
Actual behavior:
if(myBoolean) {
var result = MyObject.thisIsAVeryLongFunctionNameWithParameters(firstParam,
secondParam, thirdParam, fourthParam, fifthParam);
}
Note that the close curly brace for the if is indented an extra level.
All the code which follows will also be indented an extra level, including closing function and object definitions. In a long file, the end can be pretty far over to the right compared to where it should be.
Reproduces how often:
Always, even in safe mode.
Versions
Atom : 1.23.2
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0
Windows: 10 Pro
@rsese Thanks for reporting the reproduction. I think the line 3 handling is reasonable and that the additional indent of the line continuation might be helpful. Line 2 should definitely be indented one level past line 1.
Also if anybody's confused, I have four spaces per indent and @rsese has two.
Description
A multiline function call causes Atom's autoindenter to perform unexpectedly, adding an extra layer to indentation from that call down.
Steps to Reproduce
Expected behavior:
Code formatted like this:
Note that the close curly brace for the
if
is aligned with the if statement.Actual behavior:
Note that the close curly brace for the
if
is indented an extra level.All the code which follows will also be indented an extra level, including closing function and object definitions. In a long file, the end can be pretty far over to the right compared to where it should be.
Reproduces how often:
Always, even in safe mode.
Versions
Atom : 1.23.2
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0
Windows: 10 Pro
Additional Information
May be related to #553.
The text was updated successfully, but these errors were encountered: