]> git.cworth.org Git - sup/commitdiff
better fix for reply-mode and edit-message-mode header tweaking
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Fri, 2 Nov 2007 17:27:22 +0000 (17:27 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Fri, 2 Nov 2007 17:27:22 +0000 (17:27 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@662 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/edit-message-mode.rb
lib/sup/modes/reply-mode.rb

index b92800953b0b4d741592a3840f8a2743001273fa..3ae0eeb8284f2ac8098f664ac6e4a1662e188f3a 100644 (file)
@@ -286,13 +286,17 @@ EOS
     f.puts sig_lines if full unless $config[:edit_signature]
   end  
 
-private
+protected
 
   def edit_field field
     case field
     when "Subject"
       text = BufferManager.ask :subject, "Subject: ", @header[field]
-      @header[field] = parse_header field, text if text
+       if text
+         @header[field] = parse_header field, text
+         update
+         field
+       end
     else
       default =
         case field
@@ -306,12 +310,14 @@ private
       if contacts
         text = contacts.map { |s| s.longname }.join(", ")
         @header[field] = parse_header field, text
+        update
+        field
       end
     end
-
-    update
   end
 
+private
+
   def sanitize_body body
     body.gsub(/^From /, ">From ")
   end
index 1595bffcd2153c92dd206bc2181fad7978e492a6..d176499018bc784b07b6fdc6573e184faab22f2d 100644 (file)
@@ -121,11 +121,12 @@ protected
     (@m.refs + [@m.id]).map { |x| "<#{x}>" }.join(" ")
   end
 
-  def edit_message_or_field
-    @selected_type = :user
-    self.header = @headers[:user]
-    update
-    super
+  def edit_field field
+    edited_field = super
+    if edited_field && edited_field != "Subject"
+      @selected_type = :user
+      update
+    end
   end
   
   def move_cursor_left