fixed PY-6995 Extra indents when pasting code with non-rectangle selection between top-level statements

This commit is contained in:
Ekaterina Tuzova
2012-07-31 16:54:44 +04:00
parent caf2af4b8c
commit 8f303236f0
5 changed files with 25 additions and 1 deletions

View File

@@ -97,7 +97,7 @@ public class PythonCopyPasteProcessor implements CopyPastePreProcessor {
newText += "\n";
}
else
newText = new String(text); //user already prepared place to paste to and we just want to indent right
newText = new String(newText); //user already prepared place to paste to and we just want to indent right
}
}
return newText;

View File

@@ -0,0 +1,9 @@
c = 1
class A(object):
def foo(self):
pass
def foo(self):
pass

View File

@@ -0,0 +1,6 @@
c = 1
class A(object):
def foo(self):
pass
<caret>

View File

@@ -0,0 +1,5 @@
c = 1
class A(object):
<selection>def foo(self):
pass</selection>

View File

@@ -199,6 +199,10 @@ public class PyCopyPasteTest extends PyTestCase {
doTest();
}
public void testNonRectangleTopLevel() { //PY-6995
doTest();
}
private void doTest() {
String name = getTestName(false);