commit 0790118e696e872c27cabd83ec4ed4762e80ab90
parent 3ef5e2e01079b557432ad57cabadee36a02b9cf4
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date: Fri, 14 Dec 2007 00:54:04 +0000
make left/h and right/l have the same behavior in edit-message-mode
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@769 5c8cc53c-5e98-4d25-b20a-d8db53a31250
Diffstat:
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
@@ -50,8 +50,8 @@ EOS
k.add :save_as_draft, "Save as draft", 'P'
k.add :attach_file, "Attach a file", 'a'
k.add :delete_attachment, "Delete an attachment", 'd'
- k.add :move_cursor_right, "Move selector to the right", :right
- k.add :move_cursor_left, "Move selector to the left", :left
+ k.add :move_cursor_right, "Move selector to the right", :right, 'l'
+ k.add :move_cursor_left, "Move selector to the left", :left, 'h'
end
def initialize opts={}
@@ -163,15 +163,21 @@ EOS
protected
def move_cursor_left
- return unless curpos < @selectors.length
- @selectors[curpos].roll_left
- buffer.mark_dirty
+ if curpos < @selectors.length
+ @selectors[curpos].roll_left
+ buffer.mark_dirty
+ else
+ col_left
+ end
end
def move_cursor_right
- return unless curpos < @selectors.length
- @selectors[curpos].roll_right
- buffer.mark_dirty
+ if curpos < @selectors.length
+ @selectors[curpos].roll_right
+ buffer.mark_dirty
+ else
+ col_right
+ end
end
def add_selector s