fixed not moving statements in case of selection

This commit is contained in:
Ekaterina Tuzova
2012-04-05 16:03:55 +04:00
parent 4ecc34e639
commit da8e4ad134
@@ -48,10 +48,7 @@ public class StatementMover extends LineMover {
public boolean checkAvailable(@NotNull Editor editor, @NotNull PsiFile file, @NotNull MoveInfo info, boolean down) {
if (!(file instanceof PyFile)) return false;
init(editor, info, down);
// Do not move in case of selection
if (editor.getSelectionModel().hasSelection()){
return false;
}
Document document = editor.getDocument();
String lineToMove = document.getText(new TextRange(getLineStartSafeOffset(document, info.toMove.startLine), getLineStartSafeOffset(document, info.toMove.endLine)));
if (StringUtil.isEmptyOrSpaces(lineToMove)) {