mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed PY-5196 Move statement: gets stuck on moving class after compound statement
This commit is contained in:
+1
-1
@@ -203,7 +203,7 @@ public class StatementMover extends LineMover {
|
||||
if (tmp != null) {
|
||||
int start = editor.offsetToLogicalPosition(tmp.getParent().getTextRange().getStartOffset()).line;
|
||||
int end = editor.offsetToLogicalPosition(tmp.getParent().getTextRange().getEndOffset()).line;
|
||||
if (start == end && start == info.toMove2.startLine)
|
||||
if (start == info.toMove2.startLine && (start == end || tmp.getParent() instanceof PyClass || tmp.getParent() instanceof PyFunction))
|
||||
element2 = tmp;
|
||||
else
|
||||
element2 = PyPsiUtils.getSignificantToTheLeft(element2, true);
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
if condition:
|
||||
test1()
|
||||
|
||||
class B(Exception):
|
||||
b=1
|
||||
clas<caret>s C:
|
||||
pass
|
||||
@@ -0,0 +1,7 @@
|
||||
if condition:
|
||||
test1()
|
||||
|
||||
class B(Exception):
|
||||
b=1
|
||||
clas<caret>s C:
|
||||
pass
|
||||
@@ -0,0 +1,7 @@
|
||||
if condition:
|
||||
test1()
|
||||
|
||||
class C:
|
||||
pass
|
||||
class B(Exception):
|
||||
b=1
|
||||
@@ -103,4 +103,8 @@ public class PyStatementMoverTest extends PyTestCase {
|
||||
public void testNestedTry() { // PY-5192
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testClass() { // PY-5196
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user