From: wmorgan Date: Sun, 28 Oct 2007 17:38:04 +0000 (+0000) Subject: fix label list mode bug: selecting sometimes picks the wrong thing X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=359c7b75a0d5c9a131b117492776fa4ec9bcc390;p=sup 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 --- diff --git a/lib/sup/modes/label-list-mode.rb b/lib/sup/modes/label-list-mode.rb index fd994f7..ee9b983 100644 --- 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