From 3f7b7b3416c9435b5d0ce27c617ead50cb33eccb Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 26 Sep 2010 15:42:44 +0200 Subject: vim_mode: Move some code, no changes. --- vim-mode/vim_mode.pl | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'vim-mode/vim_mode.pl') diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 4fa4120..24e134c 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -211,6 +211,21 @@ sub _get_pos_and_length { } +sub cmd_movement_h { + my ($count, $pos) = @_; + + $pos -= $count; + $pos = 0 if $pos < 0; + _input_pos($pos); +} +sub cmd_movement_l { + my ($count, $pos) = @_; + + my $length = _input_len(); + $pos += $count; + $pos = $length if $pos > $length; + _input_pos($pos); +} # later history (down) sub cmd_movement_j { my ($count, $pos) = @_; @@ -233,7 +248,6 @@ sub cmd_movement_j { _input_pos(0); } } - # earlier history (up) sub cmd_movement_k { my ($count, $pos) = @_; @@ -253,22 +267,6 @@ sub cmd_movement_k { } } -sub cmd_movement_h { - my ($count, $pos) = @_; - - $pos -= $count; - $pos = 0 if $pos < 0; - _input_pos($pos); -} -sub cmd_movement_l { - my ($count, $pos) = @_; - - my $length = _input_len(); - $pos += $count; - $pos = $length if $pos > $length; - _input_pos($pos); -} - sub cmd_movement_f { my ($count, $pos, $char) = @_; -- cgit v1.2.3