aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode/vim_mode.pl
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-09-26 13:42:44 +0000
committerSimon Ruderich <simon@ruderich.org>2010-09-26 13:42:44 +0000
commit3f7b7b3416c9435b5d0ce27c617ead50cb33eccb (patch)
tree3e170f8b7ba432b25e86d951e1630b9b2fd224c2 /vim-mode/vim_mode.pl
parentvim_mode: Implement yank/paste: y p P. (diff)
downloadirssi-scripts-3f7b7b3416c9435b5d0ce27c617ead50cb33eccb.tar.gz
irssi-scripts-3f7b7b3416c9435b5d0ce27c617ead50cb33eccb.zip
vim_mode: Move some code, no changes.
Diffstat (limited to 'vim-mode/vim_mode.pl')
-rw-r--r--vim-mode/vim_mode.pl32
1 files changed, 15 insertions, 17 deletions
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) = @_;