Skip to content
Snippets Groups Projects
Commit ba41e2f5 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[clike mode] Add an allmanIndentation mode option

Issue #3581
parent de1f27dc
No related branches found
No related tags found
No related merge requests found
......@@ -220,6 +220,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
}
var closing = firstChar == ctx.type;
var switchBlock = ctx.prev && ctx.prev.type == "switchstatement";
if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
return ctx.indented
}
if (isStatement(ctx.type))
return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment