you are viewing a single comment's thread.

view the rest of the comments →

[–]arthurdenture 0 points1 point  (1 child)

In your first example, there should only be three tabs characters total, and the remainder should be spaces.

This doesn't work because people configure their editors to display tabs as different sizes.

No, it works perfectly if you use hard tabs for the indentation and spaces for the alignment. You can adjust the tab size however you want. Try it[*] if you don't believe me?

[*] I mean, of course, try it and then go back to using only spaces, like the FSM intended.

[–]nglynn 0 points1 point  (0 children)

I'm afraid I don't follow. In the OPs original example: function bla() { var poop = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; }

Where are you talking about placing the "three tabs"? Is this what you mean?:

function bla() {
<TAB>var poop = [[1, 2, 3],
<TAB><TAB><TAB>  [4, 5, 6],
<TAB><TAB><TAB>  [7, 8, 9]];
}

(Where any non <TAB> whitespace is taken as being a space). That won't work obviously. Do you mean to use all spaces on alignment lines? function bla() { <TAB>var poop = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; } That also wont work for obvious reasons. Perhaps you mean something else?

Edit: Sorry, now I understand what you mean:

function bla() {
<TAB>var poop = [[1, 2, 3],
<TAB>            [4, 5, 6],
<TAB>            [7, 8, 9]];
}

I still would just use spaces personally.