Ensure strtags has no duplicates, even pre-init
authorJack Miller <jack@codezen.org>
Tue, 17 Mar 2015 16:37:03 +0000 (11:37 -0500)
committerJack Miller <jack@codezen.org>
Tue, 17 Mar 2015 16:37:03 +0000 (11:37 -0500)
If we get more than one NEWTAG pre-init, we weren't checking if we'd
already recorded it in strtags.

canto_curses/config.py

index 9c9165a..06561a6 100644 (file)
@@ -840,8 +840,10 @@ class CantoCursesConfig(SubThread):
 
         if not self.initd:
             for tag in tags:
-                self.vars["strtags"].append(tag)
-                self.config["tagorder"].append(tag)
+                if tag not in self.vars["strtags"]:
+                    self.vars["strtags"].append(tag)
+                if tag not in self.config["tagorder"]:
+                    self.config["tagorder"].append(tag)
             return
 
         c = self.get_conf()