sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 4ab181a0665da2112394e09cb35e7a25b68543d1
parent 6f5306d0c8a6ad21d918480a6541d3475384a0ef
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Sat, 13 Jan 2007 00:04:21 +0000

improved contact-list-mode


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

Diffstat:
M doc/TODO | 3 ++-
M lib/sup/contact.rb | 2 +-
M lib/sup/modes/contact-list-mode.rb | 3 ++-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/doc/TODO b/doc/TODO
@@ -1,4 +1,4 @@
-fix up contact list mode: should display while loading, and when you add an alias, should move everything else to the right
+alias authors in thread-view-mode
 add a flag to sup-import to force the creation of a new source (see http://rubyforge.org/forum/forum.php?thread_id=10973&forum_id=10340)
 fix bug: when returning from a shelling out, ncurses is crazy 
 batch deletion
@@ -23,6 +23,7 @@ pop
 move sup-import argument handling to getopt
 be able to mark individual messages as spam in thread-view-mode
 
+x fix up contact list mode: should display while loading, and when you add an alias, should move everything else to the right
 x fix bug: envelope-to thing still not working
 x fix snippet repetitions with small snippets
 x fix next and previous in thread-view-mode with <unreceived messages>
diff --git a/lib/sup/contact.rb b/lib/sup/contact.rb
@@ -24,7 +24,7 @@ class ContactManager
     @people.delete oldentry.first if oldentry
     @people[aalias] = person
   end
-  def drop_contact person; @people.delete person; end
+  def drop_contact person; @people.find { |a, p| @people.delete a if p == person }; end
   def delete t; @people.delete t; end
   def resolve aalias; @people[aalias]; end
 
diff --git a/lib/sup/modes/contact-list-mode.rb b/lib/sup/modes/contact-list-mode.rb
@@ -80,11 +80,12 @@ class ContactListMode < LineCursorMode
     a = BufferManager.ask(:alias, "alias for #{p.longname}: ", @user_contacts[p]) or return
     if a.empty?
       ContactManager.drop_contact p
+      @user_contacts.delete p
     else
       ContactManager.set_contact p, a
       @user_contacts[p] = a
-      update_text_for_line curpos
     end
+    regen_text # in case columns need to be shifted
   end
 
   def load_in_background