From ff9b00efd7f33ad0f2958a13af796d8012706559 Mon Sep 17 00:00:00 2001 From: Rustam Vishnyakov Date: Tue, 5 Jul 2016 20:57:27 +0300 Subject: [PATCH] FIXED WI-20186 Caret isn't indented if there is a comment after block start statement --- .../codeStyle/lineIndent/JavaLikeLangLineIndentProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/lineIndent/JavaLikeLangLineIndentProvider.java b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/lineIndent/JavaLikeLangLineIndentProvider.java index 1d61783c818e..c5cd1618a426 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/lineIndent/JavaLikeLangLineIndentProvider.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/lineIndent/JavaLikeLangLineIndentProvider.java @@ -138,7 +138,8 @@ public abstract class JavaLikeLangLineIndentProvider extends FormatterBasedLineI } else { SemanticEditorPosition position = getPosition(editor, offset); - if (position.before().isAt(RightParenthesis)) { + position = position.before().beforeOptional(LineComment).beforeOptional(Whitespace); + if (position.isAt(RightParenthesis)) { int offsetAfterParen = position.getStartOffset() + 1; position.beforeParentheses(LeftParenthesis, RightParenthesis); if (!position.isAtEnd()) {