sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 359c7b75a0d5c9a131b117492776fa4ec9bcc390
parent 1500bc207e5574b22b2201cb552e4f9b520a5ab1
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Sun, 28 Oct 2007 17:38:04 +0000

fix label list mode bug: selecting sometimes picks the wrong thing

git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@640 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M lib/sup/modes/label-list-mode.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/sup/modes/label-list-mode.rb b/lib/sup/modes/label-list-mode.rb
@@ -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