From f814855c350c94dde979b17cfd2895175a624e2d Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Fri, 6 Jul 2012 12:00:04 +0400 Subject: [PATCH 1/4] fixed PY-6843 package install confused by whitespace in directory name? --- .../src/com/intellij/execution/util/ExecUtil.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java b/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java index 467dba841aab..d967259e8bc6 100644 --- a/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java +++ b/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java @@ -160,6 +160,10 @@ public class ExecUtil { return sudoAndGetOutput(scriptPath, prompt, null); } + /** + * + * @param scriptPath is already escaped filepath + */ public static ProcessOutput sudoAndGetOutput(@NotNull final String scriptPath, @NotNull final String prompt, @Nullable String workDir) throws IOException, ExecutionException { From be16fef6733765919392b883e450de42dae81df6 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Fri, 6 Jul 2012 14:27:30 +0400 Subject: [PATCH 2/4] fixed PY-6889 Incorrect indent on pasting class method on module-level right after the class itself --- .../editorActions/CopyPasteIndentProcessor.java | 8 ++++++-- .../editorActions/IndentTransferableData.java | 10 ++++++++-- 2 files changed, 14 insertions(+), 4 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 3e5a2cdadb08..a42ea96181c3 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java @@ -52,6 +52,7 @@ public class CopyPasteIndentProcessor implements CopyPastePostProcessor= 0) { minIndent = Math.min(minIndent, indent); + maxIndent = Math.max(minIndent, indent); } } int firstNonSpaceChar = CharArrayUtil.shiftForward(document.getCharsSequence(), startOffsets[0], " \t"); int firstLineLeadingSpaces = (firstNonSpaceChar <= document.getLineEndOffset(selStartLine)) ? firstNonSpaceChar - startOffsets[0] : 0; - return new IndentTransferableData(minIndent, firstLineLeadingSpaces); + return new IndentTransferableData(minIndent, maxIndent, firstLineLeadingSpaces); } private static boolean acceptFileType(FileType fileType) { @@ -154,7 +156,9 @@ public class CopyPasteIndentProcessor implements CopyPastePostProcessor Date: Fri, 6 Jul 2012 15:33:36 +0400 Subject: [PATCH 3/4] fixed PY-6887 Paste changes code logic when making top-level function inner --- .../codeInsight/editorActions/CopyPasteIndentProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 a42ea96181c3..cfebc397ff69 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java @@ -65,7 +65,7 @@ public class CopyPasteIndentProcessor implements CopyPastePostProcessor strings = StringUtil.split(pastedText, "\n"); - if (caretColumn > value.getIndent() && !strings.isEmpty() && + if (caretColumn >= value.getIndent() && !strings.isEmpty() && StringUtil.isEmptyOrSpaces(strings.get(strings.size()-1))) endLine -=1; for (int i = startLine+1; i <= endLine; i++) { From 88648925ae559bcb702828cc5fb0b599aa1b6314 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Mon, 9 Jul 2012 20:47:24 +0400 Subject: [PATCH 4/4] fixed caret position in copy-paste --- .../editorActions/CopyPasteIndentProcessor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 cfebc397ff69..72b1995c8bdd 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyPasteIndentProcessor.java @@ -151,12 +151,15 @@ public class CopyPasteIndentProcessor implements CopyPastePostProcessor strings = StringUtil.split(pastedText, "\n"); - if (caretColumn >= value.getIndent() && !strings.isEmpty() && + if (realCaretColumn >= value.getIndent() && !strings.isEmpty() && StringUtil.isEmptyOrSpaces(strings.get(strings.size()-1))) endLine -=1; for (int i = startLine+1; i <= endLine; i++) { - int indent = value.getFirstLineLeadingSpaces() <= caretColumn || + int indent = value.getFirstLineLeadingSpaces() <= realCaretColumn || value.getFirstLineLeadingSpaces() == value.getMaxIndent()? value.getIndent() : -value.getIndent(); EditorActionUtil.indentLine(project, editor, i, indent); }