Skip to content

Commit fc71e46

Browse files
committed
Properly reindent lines starting with an opening brace below composite statements
FIX: Properly dedent lines starting with an opening curly brace below composite statements like `for`/`while`. See https://discuss.codemirror.net/t/can-i-use-allman-style-on-codemirror/9105
1 parent 6a735f3 commit fc71e46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/javascript.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const javascriptLanguage = LRLanguage.define({
2727
Block: delimitedIndent({closing: "}"}),
2828
ArrowFunction: cx => cx.baseIndent + cx.unit,
2929
"TemplateString BlockComment": () => null,
30-
"Statement Property": continuedIndent({except: /^{/}),
30+
"Statement Property": continuedIndent({except: /^\s*{/}),
3131
JSXElement(context) {
3232
let closed = /^\s*<\//.test(context.textAfter)
3333
return context.lineIndent(context.node.from) + (closed ? 0 : context.unit)

0 commit comments

Comments
 (0)