fixed PY-5199 Move statement: do not perform action with cursor on empty line

This commit is contained in:
Ekaterina Tuzova
2011-12-02 12:27:46 +01:00
parent a0b8b18a56
commit 72760de60a
@@ -44,6 +44,12 @@ public class StatementMover extends LineMover {
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)) {
info.toMove2 = info.toMove;
return true;
}
//reset
myStatementListToAddPass = null;