From aefa8af60ef463fb125c60603f8683f8457ffd23 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Tue, 23 Mar 2010 20:22:46 +0100 Subject: [PATCH] [runDialog] Don't add duplicates to the history When the user runs the same command as the last one saved there is no need to save it again, otherwise we the history might end up having lots of dupes which makes searching for an old command harder. https://bugzilla.gnome.org/show_bug.cgi?id=613731 --- js/ui/runDialog.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 403e6df6f..ca2fb262e 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -330,8 +330,10 @@ RunDialog.prototype = { _run : function(input, inTerminal) { let command = input; - this._history.push(input); - this._saveHistory(); + if (this._history.length > 0 && this._history[this._history.length - 1] != input) { + this._history.push(input); + this._saveHistory(); + } this._commandError = false; let f;