einars/js-beautify — pull request #241 by johnkpaul (2013-05-07 15:22:16+00:00)
Title: Beautifying function call chains that end with a callback results in incorrect formatting

I am using `indent_size: 2` and `keep_function_indentation: true`. I'm trying to beautify chained function calls that end in a callback. Here is the example input:

```javascript
obj.first()
.second()
.last(function (err, response) {
console.log(err);
});
```

I expect this to already be correctly formatted and not change by my jsbeautifer config, but when I run it, I get this output.

```javascript
obj.first()
.second()
.last(function (err, response) {
console.log(err);
});
```

The last two lines are moved one indentation size too far to the left.

In case this is caused by my misunderstanding of the options, here is my whole jsbeautfier config object.

```javascript
options: {
"indent_size": 2,
"indent_char": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 10,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": true,
"space_before_conditional": true,
"eval_code": false,
"indent_case": true,
"unescape_strings": false,
"space_after_anon_function": true
}
}
```