tamzinblake / js3-mode

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

Indent problem #31

Closed pigmej closed 12 years ago

pigmej commented 12 years ago

Example code

      something({ value: "data"
                , errback: function(code, e) {
                    var u = new Something(user_data)
                    u.method( function(data) {
                      res.writeHead(201)
                      res.json(data)
                    }
                                , function(data) {
                                  res.writeHead(500)
                                  res.json(data)
                                }
                                )
                  }
                , callback: function(data){
                    res.writeHead(403)
                    res.json()
                  }
      })
      res.writeHead(201)
      res.end()

and

      something({ value: "data"
                , errback: function(code, e) {
                    var u = new Something(user_data)
                    u.method(
                      function(data) {
                        res.writeHead(201)
                        res.json(data)
                      }
  , function(data) {
    res.writeHead(500)
    res.json(data)
  }
                    )
                  }
                , callback: function(data){
                    res.writeHead(403)
                    res.json()
                  }
      })

None of them is indented correctly.

tamzinblake commented 12 years ago

This should be fixed by commit 78c549e along with issue #34

The indentation can still look weird because of the default function body indentation, but that should be submitted as a separate issue if that seems to be a problem.