fixed PY-6907 Paste leads to syntactically incorrect code in case of dedent in copied text

This commit is contained in:
Ekaterina Tuzova
2012-07-10 19:17:46 +04:00
parent de352f89b1
commit de923ff093
@@ -156,9 +156,9 @@ public class CopyPasteIndentProcessor implements CopyPastePostProcessor<IndentTr
for (String s : split) {
currentIndent = s.length() - s.trim().length();
if (split[0].equals(s) ) {
firstIndent = currentIndent;
if (currentIndent == 0)
currentIndent = textBeforeFirstLine.length();
firstIndent = currentIndent;
}
if (!StringUtil.isEmptyOrSpaces(s) && firstIndent > currentIndent)
return;