CPP-4211 Unexpected closing parent placement after command(<enter>) appcode/142.4154 clion/142.4153
authorVasily Pisar <vasily.pisar@jetbrains.com>
Thu, 20 Aug 2015 12:01:27 +0000 (15:01 +0300)
committerVasily Pisar <vasily.pisar@jetbrains.com>
Thu, 20 Aug 2015 12:06:17 +0000 (15:06 +0300)
Proper indent for comments

platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleManagerRunnable.java

index 60e41cc7963544108d5c78764789abc4f644b40e..73469a86b34eb8667729291d3221f76b7678c0de 100644 (file)
  */
 package com.intellij.psi.impl.source.codeStyle;
 
-import com.intellij.formatting.*;
+import com.intellij.formatting.CoreFormatterUtil;
+import com.intellij.formatting.FormattingMode;
+import com.intellij.formatting.FormattingModel;
+import com.intellij.formatting.FormattingModelBuilder;
 import com.intellij.injected.editor.DocumentWindow;
 import com.intellij.lang.ASTNode;
 import com.intellij.lang.LanguageFormatting;
@@ -127,7 +130,7 @@ abstract class CodeStyleManagerRunnable<T> {
   protected abstract T doPerform(int offset, TextRange range);
 
   private static boolean isInsidePlainComment(int offset, @Nullable PsiElement element) {
-    if (!(element instanceof PsiComment) || element instanceof PsiDocCommentBase || !element.getTextRange().contains(offset)) {
+    if (!(element instanceof PsiComment) || element instanceof PsiDocCommentBase || !element.getTextRange().contains(offset - 1)) {
       return false;
     }