Skip to content

Commit 8ea33dc

Browse files
pydichandramarijnh
authored andcommitted
fix extra indentation caused by ';' in 'top'/'}' contexts.
';' after end of class definition is changing context to 'statement' from 'top' (or '}'). This results in subsequent lines to be indented with 2-spaces (extra). Fix is not to pushContext when curPunc is ';' and context.type is '} or 'top'.
1 parent 8979bc7 commit 8ea33dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mode/clike/clike.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
133133
while (ctx.type == "statement") ctx = popContext(state);
134134
}
135135
else if (curPunc == ctx.type) popContext(state);
136-
else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
136+
else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement"))
137137
pushContext(state, stream.column(), "statement");
138138
state.startOfLine = false;
139139
return style;

0 commit comments

Comments
 (0)