From 240c4c00cd31771b3eede7909e66ae4466c6ff58 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Wed, 11 Jul 2012 20:58:53 +0400 Subject: [PATCH] fixed PY-6889 Incorrect indent on pasting class method on module-level right after the class itself --- .../codeInsight/editorActions/CopyPasteIndentProcessor.java | 3 +++ 1 file changed, 3 insertions(+) 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 2e9cbd7d2d97..b993d2822fdb 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java @@ -163,6 +163,9 @@ public class CopyPasteIndentProcessor implements CopyPastePostProcessor currentIndent) return; } + //insert on top level, doesn't need indent + if (caretColumn == 0 && !pastedText.startsWith(" ")) + return; if (textBeforeFirstLine.trim().length() == 0) { EditorActionUtil.indentLine(project, editor, startLine, -value.getFirstLineLeadingSpaces());