Improve rpc console history behavior
authorfsb4000 <fsb4000@yandex.ru>
Tue, 6 Jan 2015 14:16:02 +0000 (20:16 +0600)
committerfsb4000 <fsb4000@yandex.ru>
Tue, 6 Jan 2015 14:16:02 +0000 (20:16 +0600)
https://github.com/bitcoin/bitcoin/pull/4300

src/qt/rpcconsole.cpp

index 95a45b3..36459f7 100644 (file)
@@ -369,8 +369,8 @@ void RPCConsole::on_lineEdit_returnPressed()
     {
         message(CMD_REQUEST, cmd);
         emit cmdRequest(cmd);
-        // Truncate history from current position
-        history.erase(history.begin() + historyPtr, history.end());
+        // Remove command, if already in history
+        history.removeOne(cmd);
         // Append command to history
         history.append(cmd);
         // Enforce maximum history size