]> git.cworth.org Git - sup/commitdiff
minor cleanups
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 8 Nov 2007 18:35:05 +0000 (18:35 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 8 Nov 2007 18:35:05 +0000 (18:35 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@685 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/buffer.rb

index 4bc8788e3c15debf0ebcefdc62301e3605959853..d5ebff2e205f318993468ee6615bec1b5e57639c 100644 (file)
@@ -361,9 +361,7 @@ class BufferManager
         case partial#.gsub(/#{sep}+/, sep)
         when /^\s*$/
           ["", ""]
-        when /^(.+#{sep})$/
-          [$1, ""]
-        when /^(.*#{sep})?(.+?)$/
+        when /^(.*#{sep})?(.*?)$/
           [$1 || "", $2]
         else
           raise "william screwed up completion: #{partial.inspect}"
@@ -434,10 +432,8 @@ class BufferManager
     default = default_contacts.map { |s| s.to_s }.join(" ")
     default += " " unless default.empty?
     
-    recent = Index.load_contacts(AccountManager.user_emails, :num => 10).map { |c| [c.longname, c.email] }
-    contacts = ContactManager.contacts.map { |c| [ContactManager.alias_for(c), c.longname, c.email] }
-
-    Redwood::log "recent: #{recent.inspect}"
+    recent = Index.load_contacts(AccountManager.user_emails, :num => 10).map { |c| [c.full_address, c.email] }
+    contacts = ContactManager.contacts.map { |c| [ContactManager.alias_for(c), c.full_address, c.email] }
 
     completions = (recent + contacts).flatten.uniq.sort
     answer = BufferManager.ask_many_with_completions domain, question, completions, default, /\s*,\s*/