]> git.cworth.org Git - sup/commitdiff
fix label list mode bug: selecting sometimes picks the wrong thing
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 28 Oct 2007 17:38:04 +0000 (17:38 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 28 Oct 2007 17:38:04 +0000 (17:38 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@640 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/label-list-mode.rb

index fd994f756216bd3b3c7ca679b9a2bac82dbb8956..ee9b9830da39202aaf68dc8c55338d1260abaed8 100644 (file)
@@ -40,8 +40,8 @@ protected
     end.sort_by { |l, s, t, u| s.downcase }
 
     width = counts.max_of { |l, s, t, u| s.length }
-    @labels = counts.map { |l, s, t, u| l }
 
+    @labels = []
     counts.map do |label, string, total, unread|
       if total == 0 && !LabelManager::RESERVED_LABELS.include?(label)
         Redwood::log "no hits for label #{label}, deleting"
@@ -51,6 +51,7 @@ protected
 
       @text << [[(unread == 0 ? :labellist_old_color : :labellist_new_color),
           sprintf("%#{width + 1}s %5d %s, %5d unread", string, total, total == 1 ? " message" : "messages", unread)]]
+      @labels << label
       yield i if block_given?
     end.compact
   end