Fix tag order getting mangled on new tags
authorJack Miller <jack@codezen.org>
Tue, 23 Jun 2015 18:42:44 +0000 (13:42 -0500)
committerJack Miller <jack@codezen.org>
Tue, 23 Jun 2015 18:42:44 +0000 (13:42 -0500)
canto_curses/config.py

index 9a19953..71efb28 100644 (file)
@@ -936,11 +936,13 @@ class CantoCursesConfig(SubThread):
         c = self.get_conf()
 
         # Likely the same as tags
+        changes = False
         newtags = []
 
         for tag in tags:
             if tag not in c["tagorder"]:
-                c["tagorder"] = self.config["tagorder"] + [ tag ]
+                c["tagorder"] = c["tagorder"] + [ tag ]
+                changes = True
 
             if tag not in self.vars["strtags"]:
 
@@ -953,10 +955,11 @@ class CantoCursesConfig(SubThread):
 
                 self.vars["strtags"].append(tag)
                 newtags.append(tag)
+                changes = True
 
         # If there aren't really any tags we didn't know about, no bail.
 
-        if not newtags:
+        if not changes:
             return
 
         self.set_conf(c)