Smart indent: Custom indentation

Hi there,

right now I'm trialing WebStorm for JavaScript developement and it feels pretty good so far. One thing that bothers me a little is the following:

I'm used to have the following indentation when i declare an array with multiple objects at once (this stuff is e.g. needed pretty often when working with ExtJS):

var cfg = [{

name: 'name1',

size: 12

},{

name: 'name2',

size: 20

},{

name: 'name3',

size: 2
}];

Unfortunately this isn't working too great with the smart indentation feature. E.g. if i press enter after the first "name"-attribute (after "name: 'name1'") the cursor won't be in the same column as the "name"-attribute (2 tabs in this example) but 1 tab too early.

Another example:
If i put the cursor after the "size"-attribute of the 2. object (after "size: 20"), press enter and write a closing curly bracket "}" i would expect it to be in the same column as the related opening one which would be on indentation-level 1 (1 tab). Instead it is on level 0...

I really hope someone could point me to a setting which corrects this or help me in any other way. What I've seen so far, WebStorm seems like a really good IDE for JavaScript but this would decrease the experience for me by a high degree...

Thanks & best regards

Please sign in to leave a comment.