This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Multiline call causes auto-indent error #646
Open
Description
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
- 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
Additional Information
May be related to #553.