]> git.cworth.org Git - sup/commitdiff
bugfix for label selection
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 30 Jul 2007 05:03:52 +0000 (05:03 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 30 Jul 2007 05:03:52 +0000 (05:03 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@512 5c8cc53c-5e98-4d25-b20a-d8db53a31250

bin/sup
doc/TODO
lib/sup/modes/label-list-mode.rb

diff --git a/bin/sup b/bin/sup
index 47d9ba9c57dd06c2d6f0fe20bd247868071f4a1f..59785c98d9192c9975807af9587a544826edbfef 100644 (file)
--- a/bin/sup
+++ b/bin/sup
@@ -221,14 +221,13 @@ begin
         user_label = bm.ask_with_completions :label, "Show threads with label (enter for listing): ", labels
         user_label = bm.spawn_modal("Label list", LabelListMode.new) if user_label && user_label.empty?
         
-        label = LabelManager.label_for user_label if user_label
-        case label
+        case user_label
         when nil
         when :inbox
           BufferManager.raise_to_front InboxMode.instance.buffer
         else
           b = BufferManager.spawn_unless_exists("All threads with label '#{user_label}'") do
-            mode = LabelSearchResultsMode.new([label])
+            mode = LabelSearchResultsMode.new([user_label])
           end
           b.mode.load_threads :num => b.content_height
         end
index 3561fc50b8c505f4c17c50390ab7b33bd3f4b97b..7522377da547fb633de76135875f2acfd8cf3b59 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,12 +1,12 @@
 for next release
 ----------------
+_ mailing list subscribe/unsubscribe
 _ BufferManager#ask_for_labels opens up label-list-mode if empty
 _ tab completion for mid-text cursors
 _ forward attachments
 _ messages as attachments
 _ individual labeling in thread-view-mode
 _ tab completion for to: and cc: in compose-mode
-_ translate aliases in queries on to: and from: fields
 _ use trac or something. this file is getting a little silly.
 _ gpg integration
 _ user-defined hooks
@@ -33,6 +33,7 @@ _ undo
 _ gmail support
 _ warnings: top-posting, missing attachment, ruby-talk:XXXX detection
 _ Net::SMTP support
+x translate aliases in queries on to: and from: fields
 x tab completion on labeling
 
 future
index dcee795deb64b06f7f40c941c00af9b3771b0cd7..eae814958b10f228dabaa75748ca2cdd048454c6 100644 (file)
@@ -30,9 +30,9 @@ protected
   
   def regen_text
     @text = []
-    @labels = LabelManager.listable_labels
+    labels = LabelManager.listable_labels
 
-    counts = @labels.map do |label|
+    counts = labels.map do |label|
       string = LabelManager.string_for label
       total = Index.num_results_for :label => label
       unread = Index.num_results_for :labels => [label, :unread]
@@ -40,6 +40,7 @@ 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 }
 
     counts.map do |label, string, total, unread|
       if total == 0 && !LabelManager::RESERVED_LABELS.include?(label)