sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 21d84d24a16b21b8269e5224664bddabd53bc652
parent 66e183c5d7a1c12f118505bc6d48dd52492179cd
Author: Eric Weikl <eric.weikl@gmx.net>
Date:   Sun, 13 Nov 2011 19:57:59 +0100

Added simple auto-completion to search prompt

Currently, label completions for all labels are supported, as well as
these keywords: from, to, after, date, before, date, limit, AND, OR, NOT

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 }