Better version of previous commit
authorJack Miller <jack@codezen.org>
Fri, 30 Jan 2015 22:33:31 +0000 (16:33 -0600)
committerJack Miller <jack@codezen.org>
Fri, 30 Jan 2015 22:33:31 +0000 (16:33 -0600)
- Sub this is on newitems instead of converting redraw into a full loop.

canto_curses/taglist.py

index 4b16cef..88ba7b3 100644 (file)
@@ -988,6 +988,8 @@ class TagList(GuiBase):
         prev_sel = None
 
         for tag in self.callbacks["get_var"]("taglist_visible_tags"):
+            tag.curpos = self.height
+
             tag.prev_obj = prev_obj
             tag.next_obj = None
 
@@ -1010,6 +1012,8 @@ class TagList(GuiBase):
                 continue
 
             for story in tag:
+                story.curpos = self.height
+
                 if not self.first_story:
                     self.first_story = story
 
@@ -1195,14 +1199,6 @@ class TagList(GuiBase):
             obj.lines(self.width)
             obj.curpos = curpos
 
-            # If we're outside of the render window, then skip the actual
-            # rendering, but stub in curpos.
-
-            if w_offset >= self.height:
-                obj.curpos = self.height
-                obj = obj.next_obj
-                continue
-
             # Copy item into window
             w_offset, curpos = self._partial_render(obj, w_offset, curpos)
 
@@ -1240,6 +1236,9 @@ class TagList(GuiBase):
 
                 rendered_header = True
 
+            if w_offset >= self.height:
+                break
+
             obj = obj.next_obj
 
         self.callbacks["refresh"]()