mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 23:06:24 +07:00
FIXED IDEA-159285 Editor doesn't auto-indent within switch-case correctly
This commit is contained in:
+6
@@ -172,6 +172,12 @@ public abstract class JavaLikeLangLineIndentProvider extends FormatterBasedLineI
|
||||
}
|
||||
while (!position.isAtEnd()) {
|
||||
if (currLanguage == Language.ANY || currLanguage == null) currLanguage = position.getLanguage();
|
||||
if (position.isAt(Colon)) {
|
||||
SemanticEditorPosition afterColon = getPosition(position.getEditor(), position.getStartOffset()).after().afterOptional(Whitespace);
|
||||
if (position.isAfterOnSameLine(SwitchCase, SwitchDefault)) {
|
||||
return afterColon.getStartOffset();
|
||||
}
|
||||
}
|
||||
if (position.isAtAnyOf(Semicolon, BlockOpeningBrace, BlockClosingBrace, BlockComment, DocBlockEnd, LineComment, LeftParenthesis) ||
|
||||
(position.getLanguage() != Language.ANY) && !position.isAtLanguage(currLanguage)) {
|
||||
SemanticEditorPosition statementStart = getPosition(position.getEditor(), position.getStartOffset());
|
||||
|
||||
Reference in New Issue
Block a user