Reorder story theme colors
authorJack Miller <jack@codezen.org>
Sat, 13 Jun 2015 18:57:14 +0000 (13:57 -0500)
committerJack Miller <jack@codezen.org>
Sat, 13 Jun 2015 18:57:14 +0000 (13:57 -0500)
This prioritizes the addition of color codes so that more specific
information overrides less specific information.

For example, "selected" is now enabled after "unread" so that ":color
selected white" will turn the single selection white instead of having
that color overridden by the unread color which is far more general.

canto_curses/story.py

index 25987c3..6099862 100644 (file)
@@ -258,29 +258,29 @@ class Story(PluginHandler):
     def eval(self):
         s = ""
 
-        if self.selected:
-            s += cc("selected")
-
-        if self.marked:
-            s += cc("marked") + "[*]"
-
         if "read" in self.content["canto-state"]:
             s += cc("read")
         else:
             s += cc("unread")
 
+        if self.marked:
+            s += cc("marked") + "[*]"
+
+        if self.selected:
+            s += cc("selected")
+
         s += prep_for_display(self.content["title"])
 
-        if "read" in self.content["canto-state"]:
-            s += cc.end("read")
-        else:
-            s += cc.end("unread")
+        if self.selected:
+            s += cc.end("selected")
 
         if self.marked:
             s += cc.end("marked")
 
-        if self.selected:
-            s += cc.end("selected")
+        if "read" in self.content["canto-state"]:
+            s += cc.end("read")
+        else:
+            s += cc.end("unread")
 
         return s