[gnome-shell] [runDialog] Don't add duplicates to the history



commit aefa8af60ef463fb125c60603f8683f8457ffd23
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Tue Mar 23 20:22:46 2010 +0100

    [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 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js
index 403e6df..ca2fb26 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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]