sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 6e48eb4581d3ef931e00d15534c1dae216f70a79
parent 3e22ef8a51bba3003bb8b1ec8947c8a0b9641c68
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Sat, 27 Oct 2007 22:54:17 +0000

fix label tab-completion downcase issue

git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@631 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M bin/sup | 2 +-
M lib/sup/buffer.rb | 2 +-
M lib/sup/label.rb | 10 ++++++++++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/bin/sup b/bin/sup
@@ -238,7 +238,7 @@ begin
           when nil, /^\s*$/
             bm.spawn_modal("Label list", LabelListMode.new) if user_label && user_label.empty?
           else
-            user_label.intern
+            LabelManager.label_for user_label
           end
         
         case user_label
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
@@ -340,7 +340,7 @@ class BufferManager
 
   def ask_with_completions domain, question, completions, default=nil
     ask domain, question, default do |s|
-      completions.select { |x| x =~ /^#{s}/i }.map { |x| [x.downcase, x] }
+      completions.select { |x| x =~ /^#{s}/i }.map { |x| [x, x] }
     end
   end
 
diff --git a/lib/sup/label.rb b/lib/sup/label.rb
@@ -50,6 +50,16 @@ class LabelManager
       l.to_s
     end
   end
+
+  def label_for s
+    l = s.intern
+    l2 = s.downcase.intern
+    if RESERVED_LABELS.include? l2
+      l2
+    else
+      l
+    end
+  end
   
   def << t
     t = t.intern unless t.is_a? Symbol