diff --git a/platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java b/platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java index ab3174bb3b0e..e60f7949924c 100644 --- a/platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java +++ b/platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java @@ -235,7 +235,9 @@ public abstract class AbstractConsoleRunnerWithHistory { if (lineNumber > 0){ caretModel.moveCaretRelatively(0, -1, false, consoleEditor.getSelectionModel().hasBlockSelection(), true); } else { - historyProcessor.process(e, myHistory.getHistoryPrev()); + if (myHistory.hasHistory(false)) { + historyProcessor.process(e, myHistory.getHistoryPrev()); + } } } }; @@ -246,7 +248,9 @@ public abstract class AbstractConsoleRunnerWithHistory { if (lineNumber < document.getLineCount() - 1){ caretModel.moveCaretRelatively(0, 1, false, consoleEditor.getSelectionModel().hasBlockSelection(), true); } else { - historyProcessor.process(e, myHistory.getHistoryNext()); + if (myHistory.hasHistory(true)) { + historyProcessor.process(e, myHistory.getHistoryNext()); + } } } };