sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 139d258fed3e33232d3146f93f76490e9e4719d1
parent 73c3915b8ed8e5e3907e6afa64e770f29e0383aa
Author: Eric Weikl <eric.weikl@tngtech.com>
Date:   Sun, 21 Apr 2013 11:18:39 -0700

Merge pull request #27 from ericweikl/develop

Add auto-completion to search prompt
Diffstat:
M bin/sup | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bin/sup b/bin/sup
@@ -300,7 +300,10 @@ begin
       b, new = bm.spawn_unless_exists("Contact List") { ContactListMode.new }
       b.mode.load_in_background if new
     when :search
-      query = BufferManager.ask :search, "Search all messages (enter for saved searches): "
+      completions = LabelManager.all_labels.map { |l| "label:#{LabelManager.string_for l}" }
+      completions = completions.each { |l| l.force_encoding 'UTF-8' if l.methods.include?(:encoding) }
+      completions += ["from:", "to:", "after:", "before:", "date:", "limit:", "AND", "OR", "NOT"]
+      query = BufferManager.ask_many_with_completions :search, "Search all messages (enter for saved searches): ", completions
       unless query.nil?
         if query.empty?
           bm.spawn_unless_exists("Saved searches") { SearchListMode.new }