[java mode] Fix indentation after class extends clause
Closes https://github.com/codemirror/codemirror5/issues/7049
This commit is contained in:
parent
a0854c752a
commit
69e38f574c
|
@ -218,7 +218,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
|
||||
if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine && isTopScope(state.context))
|
||||
return CodeMirror.Pass;
|
||||
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
||||
var closing = firstChar == ctx.type;
|
||||
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
|
||||
|
|
|
@ -162,4 +162,9 @@
|
|||
"[type StringBuffer];",
|
||||
"[type StringBuilder];",
|
||||
"[type Void];");
|
||||
|
||||
MTJAVA("indent",
|
||||
"[keyword public] [keyword class] [def A] [keyword extends] [variable B]",
|
||||
"{",
|
||||
" [variable c]()")
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue