ProcessingResult (@NotNull ChangeIndentContext context) { int targetLineIndent = getLineIndent(context, context.targetLine); List<LineInfo> lineInfos = collectIndentsGreaterOrEqualToCurrent(context, context.targetLine); int newIndent = -1; for (int i = lineInfos.size() - 1; i >= 0; i--) { LineInfo lineInfo = lineInfos.get(i); if (lineInfo.indent == targetLineIndent && !lineInfo.startsWithCompoundStatement) { continue; } newIndent = lineInfo.indent; if (lineInfo.startsWithCompoundStatement) { newIndent += context.getIndentOptions().INDENT_SIZE; } break; } if (newIndent == targetLineIndent || newIndent < 0) { return ProcessingResult.CONTINUE; } changeIndent(context, newIndent); return ProcessingResult.STOP_SUCCESSFUL; }