From 39c3ba89bf197733810b8a80d2fda8759c07b106 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Wed, 11 Oct 2017 15:13:09 +0200 Subject: [PATCH] input history works in both directions and wraps around --- src/debugger/gui/PromptWidget.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/debugger/gui/PromptWidget.cxx b/src/debugger/gui/PromptWidget.cxx index 7ad406431..5acfcd541 100644 --- a/src/debugger/gui/PromptWidget.cxx +++ b/src/debugger/gui/PromptWidget.cxx @@ -712,8 +712,9 @@ void PromptWidget::historyScroll(int direction) // Advance to the next line in the history int line = _historyLine + direction; - if ((direction < 0 && line < 0) || (direction > 0 && line > _historySize)) - return; + if(line < 0) + line += _historySize + 1; + line %= (_historySize + 1); // If they press arrow-up with anything in the buffer, search backwards // in the history.