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.
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.
Activity
rsese commentedon May 21, 2019
Thanks @wbt - reproduced in 1.39.0-nightly8 on macOS 10.12.6 (see the closing brace as reported but also line 2):
wbt commentedon May 21, 2019
@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.