diff --git a/python/src/com/jetbrains/python/codeInsight/editorActions/moveUpDown/StatementMover.java b/python/src/com/jetbrains/python/codeInsight/editorActions/moveUpDown/StatementMover.java index 7c6b91609871..f97d68198482 100644 --- a/python/src/com/jetbrains/python/codeInsight/editorActions/moveUpDown/StatementMover.java +++ b/python/src/com/jetbrains/python/codeInsight/editorActions/moveUpDown/StatementMover.java @@ -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;