Hi Marijn
I’m using indentRange
bound to TAB to indent single lines of JS.
When I start a block/object with a space and node on the same line as the brace, then CodeMirror indents the subsequent lines like this:
one({ two: three,
four: five })
let f = () => { a = 2
b = 4
return 3 }
Compare how Emacs puts the lines under the two
and the a
:
one({ two: three,
four: five })
let f = () => { a = 2
b = 4
return 3 }
Would you be open to changing this behaviour?
I’m happy to do the work. Perhaps delimitedIndent
could get an alignSpace
option.
Thanks for CM, having fun with it!
marijn
2
Who puts spaces inside object expressions?!
No, actually, this seems like it should behave the way you describe, and doesn’t even need an option. This patch implements this.
1 Like
Who puts spaces inside object expressions?!
Old dogs with weak eyes.
No, actually, this seems like it should behave the way you describe, and doesn’t even need an option. This patch implements this.
This is great, thanks, works very well.
On a similar note, CM indents like this:
export
function divW
() {
}
function divW
()
{
}
Compare with Emacs:
export
function divW
() {
}
function divW
()
{
}
I’ve added 'ExportDeclaration FunctionDeclaration': flatIndent
locally so it’s fine, but thought you might be interested.
Codium’s Ctrl-Shift-I does this:
export
function divW
() {
}
function divW
() {
}
so it’s less clear to me what the norm is.