[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
This commit is contained in:
Adel Gadllah 2010-03-23 20:22:46 +01:00
parent 14a53cc43c
commit aefa8af60e

View File

@ -330,8 +330,10 @@ RunDialog.prototype = {
_run : function(input, inTerminal) { _run : function(input, inTerminal) {
let command = input; let command = input;
this._history.push(input); if (this._history.length > 0 && this._history[this._history.length - 1] != input) {
this._saveHistory(); this._history.push(input);
this._saveHistory();
}
this._commandError = false; this._commandError = false;
let f; let f;