mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
fixed PY-6995 Extra indents when pasting code with non-rectangle selection between top-level statements
This commit is contained in:
@@ -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;
|
||||
|
||||
9
python/testData/copyPaste/NonRectangleTopLevel.after.py
Normal file
9
python/testData/copyPaste/NonRectangleTopLevel.after.py
Normal file
@@ -0,0 +1,9 @@
|
||||
c = 1
|
||||
|
||||
class A(object):
|
||||
def foo(self):
|
||||
pass
|
||||
|
||||
def foo(self):
|
||||
pass
|
||||
|
||||
6
python/testData/copyPaste/NonRectangleTopLevel.dst.py
Normal file
6
python/testData/copyPaste/NonRectangleTopLevel.dst.py
Normal file
@@ -0,0 +1,6 @@
|
||||
c = 1
|
||||
|
||||
class A(object):
|
||||
def foo(self):
|
||||
pass
|
||||
<caret>
|
||||
5
python/testData/copyPaste/NonRectangleTopLevel.src.py
Normal file
5
python/testData/copyPaste/NonRectangleTopLevel.src.py
Normal file
@@ -0,0 +1,5 @@
|
||||
c = 1
|
||||
|
||||
class A(object):
|
||||
<selection>def foo(self):
|
||||
pass</selection>
|
||||
@@ -199,6 +199,10 @@ public class PyCopyPasteTest extends PyTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNonRectangleTopLevel() { //PY-6995
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
String name = getTestName(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user