From 42dc074fd13330b332a5d0f4fffc35c5091eaaa5 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Thu, 20 Aug 2015 16:47:03 +0300 Subject: [PATCH] IDEA-70389 Alt + Ctrl + I should adjust line indent on all lines, where selection exists --- .../codeInsight/generation/AutoIndentLinesHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/AutoIndentLinesHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/AutoIndentLinesHandler.java index e53e29f011c6..6d3e505ded6c 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/generation/AutoIndentLinesHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/AutoIndentLinesHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import com.intellij.psi.codeStyle.CodeStyleManager; +import com.intellij.util.DocumentUtil; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; @@ -92,7 +93,7 @@ public class AutoIndentLinesHandler implements CodeInsightActionHandler { codeStyleManager.adjustLineIndent(file, lineStart); } } else { - codeStyleManager.adjustLineIndent(file, new TextRange(startOffset, endOffset)); + codeStyleManager.adjustLineIndent(file, new TextRange(DocumentUtil.getLineStartOffset(startOffset, document), endOffset)); } }