tamzinblake / js3-mode

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

comma first indenting error, object literal inside var statement #37

Closed samsonjs closed 12 years ago

samsonjs commented 12 years ago

The mode line is out of whack, looks like this:

  var logStream = fs.createWriteStream(argv.log, {
    flags: 'a'
                , mode: 0644
  })

but should look like this:

  var logStream = fs.createWriteStream(argv.log, {
    flags: 'a'
  , mode: 0644
  })

Changing it to this doesn't help:

  var options = { flags: 'a'
                , mode: 0644
                }
                , logStream = fs.createWriteStream(argv.log, options)

And this other case:

  var logStream = fs.createWriteStream(argv.log, { flags: 'a'
                , mode: 0644
                                                 })

I could live with any single one of these working.

tamzinblake commented 12 years ago

The third and fourth code block above are indented properly with the 'lazy' options turned off in the current build (remember to recompile). The first one should only work that way with 'lazy commas' on, and is currently broken. Working on fixing that case.

tamzinblake commented 12 years ago

github was fail so didn't notice I referred to this issue in commit 41e5ef41d926f395bb43

tamzinblake commented 12 years ago

All of these cases now work with the appropriate settings.

samsonjs commented 12 years ago

Thanks!