Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new indentation level inside array #17

Closed
mathiasbynens opened this issue Aug 13, 2010 · 1 comment
Closed

Create new indentation level inside array #17

mathiasbynens opened this issue Aug 13, 2010 · 1 comment

Comments

@mathiasbynens
Copy link
Contributor

Using the latest beautify.js (commit 78b3bf3), the following formatting error occurs:

var arr = [
 7, // true
 10, // false
 37, // true
 60, // false
 373, // true
 390, // false
 1427, // true
 1683, // false
 7879, // true
 7881 // false
];

…becomes…

var arr = [
7, // true
10, // false
37, // true
60, // false
373, // true
390, // false
1427, // true
1683, // false
7879, // true
7881 // false
];

There should probably be a new indentation level inside the array.

As always, you can reproduce this bug using the latest GitHub version of beautify.js at http://mathiasbynens.be/demo/js-beautify

@johan
Copy link

johan commented Nov 29, 2011

My favourite way of addressing this issue is to let the object type indicator ([ or {) and comma characters be what indents the line, which as a bonus makes lines look more uniform (I just filed #80 for that):

var arr =
[ 7 // true
, 10 // false
, 37 // true
, 60 // false
, 373 // true
, 390 // false
, 1427 // true
, 1683 // false
, 7879 // true
, 7881 // false
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants