commit df8eafeabeec16727c5d0b20784385f6c99f81aa
parent cd4336c03f01f6ba58fae14dacc3a86e9d091fc9
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date: Mon, 30 Jul 2007 05:03:52 +0000
bugfix for label selection
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@512 5c8cc53c-5e98-4d25-b20a-d8db53a31250
Diffstat:
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git 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
diff --git 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
diff --git a/lib/sup/modes/label-list-mode.rb b/lib/sup/modes/label-list-mode.rb
@@ -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)