Closed daaku closed 12 years ago
Hmm... that's a bug, though a very odd one - that should have been a solved special case by now, but it's easily reproducible.
Depending on configuration, the correct behavior is either:
var interval = setInterval(function() {
var foo = 1;
});
OR:
var interval = setInterval(function() {
var foo = 1;
});
OR
var interval = setInterval(function() {
var foo = 1;
});
Nevermind, that's the default behavior. I need to stop looking at these things first thing in the morning.
The default indentation for a function call with a function as the first argument is:
setInterval(function() {
var foo = 1;
});
Which in this case yields the observed indentation:
var interval = setInterval(function() {
var foo = 1;
});
You can get your desired indentation by setting js3-consistent-level-indent-inner-bracket t
- this can be done via M-x customize-group
. This option assumes that all function body indentation should be a single step from the previous line. So you get:
var interval = setInterval(function() {
var foo = 1;
});
As always, if you can think of a better suite of consistent indentation rules, please do send a gist.
Thanks, that fixed it!
I think based on the intended goals this is not as expected:
Instead it should be: