Better check whether history is not empty

This commit is contained in:
Oleg Shpynov
2010-11-24 00:47:26 +03:00
parent 1068577cd2
commit 974170b70a
@@ -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());
}
}
}
};