From d48903bd71c97f75aee82de2a9d4866d67e9f05d Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Tue, 12 Feb 2013 16:46:47 +0400 Subject: [PATCH] use the proper caret offset in case of selection. Do not overindent when replacing selection PY-8744 Smart indent pasted lines doesn't replace selection when pasting multi-line code --- .../codeInsight/editorActions/CopyPasteIndentProcessor.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java index 983e61a99a9d..386e616102c0 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java @@ -106,7 +106,6 @@ public class CopyPasteIndentProcessor implements CopyPastePostProcessor caretOffset? initialDocument.getLineNumber(caretOffset) : initialDocument.getLineCount() - 1; final int offset = getLineStartSafeOffset(initialDocument, lineNumber); - final int caretColumn = caretOffset - offset; if (bounds.getStartOffset() == offset) { String toString = initialDocument.getText(TextRange.create(offset, initialDocument.getLineEndOffset(lineNumber))); @@ -116,8 +115,8 @@ public class CopyPasteIndentProcessor implements CopyPastePostProcessor= caretOffset) { + toIndent = caretOffset - offset; } } else if (isNotApplicable(initialDocument, offset))