fixed PY-6928 Paste inserts code one line after caret and messes up code in case for as the last compound statement in function

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:08:10 +04:00
parent 326ac10754
commit 9d28280928
8 changed files with 46 additions and 1 deletions
@@ -0,0 +1,6 @@
try:
return dct[key]
except KeyError:
pass
a = 1
@@ -0,0 +1,3 @@
try:
<caret>
a = 1
@@ -0,0 +1,7 @@
class A:
def foo(self, dct, key):
try:
<selection> return dct[key]
except KeyError:
pass
</selection>
@@ -0,0 +1,8 @@
class C:
def foo(self):
x = 1
y = 2
x = 1
def foo():
pass
@@ -0,0 +1,8 @@
class C:
def foo(self):
x = 1
y = 2
<caret>
def foo():
pass
@@ -0,0 +1,4 @@
class C:
def foo(self):
<selection> x = 1</selection>
y = 2