]> git.notmuchmail.org Git - sup/commitdiff
add 'z': align current message, to thread-view-mode
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 13 Jan 2008 05:54:11 +0000 (21:54 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 13 Jan 2008 05:54:11 +0000 (21:54 -0800)
Pressing 'z' now makes the current message be top- and left-aligned in
the buffer.

lib/sup/modes/thread-view-mode.rb

index d27323e06704d78dcf71212853eb58cffcdf6f84..bd5c568765879666b5e055c54777a3d3ffd1c037 100644 (file)
@@ -34,6 +34,7 @@ EOS
     k.add :expand_all_quotes, "Expand/collapse all quotes in a message", 'o'
     k.add :jump_to_next_open, "Jump to next open message", 'n'
     k.add :jump_to_prev_open, "Jump to previous open message", 'p'
+    k.add :align_current_message, "Align current message in buffer", 'z'
     k.add :toggle_starred, "Star or unstar message", '*'
     k.add :toggle_new, "Toggle unread/read status of message", 'N'
 #    k.add :collapse_non_new_messages, "Collapse all but unread messages", 'N'
@@ -294,6 +295,11 @@ EOS
     jump_to_message nextm if nextm
   end
 
+  def align_current_message
+    m = @message_lines[curpos] or return
+    jump_to_message m
+  end
+
   def jump_to_prev_open
     m = (0 .. curpos).to_a.reverse.argfind { |i| @message_lines[i] } # bah, .to_a
     return unless m