tamzinblake / js3-mode

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

4 spaces when indenting in functions #76

Closed ralphtheninja closed 6 years ago

ralphtheninja commented 11 years ago

I'd like to have my object literals as follows:

var a = {
    name: 'foo'
  , age: 42
}

so I set

 '(js3-lazy-commas t)
 '(js3-curly-indent-offset 2)

but then the indentation level in functions becomes four spaces

function bar() {
    var p
}

, which is not what I want. Is this a bug or can I work around this somehow by setting some other variable? I've looked through all the js3-custom-variables but can't find anything.

tamzinblake commented 11 years ago

First off, js3-lazy-commas doesn't need to be set anymore. The default settings should handle that style appropriately.

Really, we need an indent offset that affects object literals but not function bodies. Doesn't seem too hard.

tamzinblake commented 11 years ago

Ugh, I'm still doing that part the way espresso-mode did. That section might need a rewrite. Marking this as a bug.

ralphtheninja commented 11 years ago

That would be very nice. Thanks Thom!

On 30 January 2013 19:19, Thom Blake notifications@github.com wrote:

Ugh, I'm still doing that part the way espresso-mode did. That section might need a rewrite. Marking this as a bug.

— Reply to this email directly or view it on GitHubhttps://github.com/thomblake/js3-mode/issues/76#issuecomment-12904048.

jm3 commented 10 years ago

:thumbsup: it would be great to have this!