Format of object literals in JS documents


I hope this is the right place to get the information. If not, please direct me to the proper forum, thank you!

The formating of JavaScript documents that make use of object literals behaves a little od to my feelings and compared to other IDEs like TextMate or Sublime Text. As soon as an object literal curly square is opened and the cursor is moved to the next line, the indent from the right site is way too much:

 $("footer#FOOTER_MAIN span.impressum[title]").tooltip({
                                                       position:"center right",
                                                       // tweak the position
                                                       offset  :[-9, -175],
                                                       effect  :'slide'
                                                       }).dynamic({ bottom:{ direction:'down', bounce:false } });

Usually the literals are positioned one tab indented, not along with the function braces. I played around with the preference options, but couldn't find a way to get it "right" (to my feelings).

Is this behaviour intended? If so, i would like to know why, because at the moment it really is annoying.

Thank you!

Best regards,
Robert Wildling
Comment actions Permalink

Hi Robert,

Please play with settings in "Settings | Code Style | JavaScript | Wrapping and Braces | Function call arguments" -- unchecking "Align when multiline" solves this for me (possibly it also affected by some other settings, but this is the one that triggers between such styles in my case).

Comment actions Permalink

Wonderful!!! Thanks a lot for the quick reply!

Have a good day!
Best regards,


Please sign in to leave a comment.