tamzinblake / js3-mode

A chimeric fork of js2-mode and js-mode
GNU General Public License v3.0
181 stars 13 forks source link

dot-first standard indentation is stupid #44

Closed tamzinblake closed 12 years ago

tamzinblake commented 12 years ago

As it turns out, the standard way js3-mode indents dot-first lines is stupid. While it's in principle nice to have all the dots lined up in nested property-gets, it falls apart as soon as any of them are function calls (which they usually are) that have multi-line content. Example:

  this.bind('enterframe', function () {
    return 1;
  })
      .bind('keydown', function (e) {
    return 2;
  })

Wouldn't it be better if it was:

  this.bind('enterframe', function () {
    return 1;
  })
  .bind('keydown', function (e) {
    return 2;
  })

Or even:

  this.bind('enterframe', function () {
    return 1;
  })
    .bind('keydown', function (e) {
    return 2;
  })

(as would be standard for many)