Edit > Lines > Auto Indent: Only looks at braces and parentheses?


#1

There are a few cases where auto indent option will not maintain the same indentation. It might be confusing if you are reformatting tab lengths.

Before

/* Multiline
 * comment.
 */

if (cond)
    console.log('hello');

for (var i=0; i<10; i++) {
    console.log(i);
}

var a = {
    foo: 'foo',
    bar: 'bar',
    baz: 'baz'
}

var b = [
    "here are some strings,",
    "they will not be indented."
]

foo(
    bar,
    baz
)

After

/* Multiline
* comment.                    // <-- Removes leading space
*/                            // <-- Removes leading space

if (cond)
console.log('hello');           // <-- Not indented

for (var i=0; i<10; i++) {
    console.log(i);
}

var a = {
    foo: 'foo',
    bar: 'bar',
    baz: 'baz'
}

var b = [
"here are some strings,",       // <-- Not indented
"they will not be indented."    // <-- Not indented
]

foo(
    bar,
    baz
)