aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode/vim_mode.pl
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-10-02 15:44:00 +0000
committerSimon Ruderich <simon@ruderich.org>2010-10-02 15:44:00 +0000
commite3e06d4e57388eac3f5ae78efd731095d0ba2dc3 (patch)
treef380cb3f1c70a6ddfcde6b11fa5c13237e6d19f1 /vim-mode/vim_mode.pl
parentvim_mode: Fix a with count. (diff)
downloadirssi-scripts-e3e06d4e57388eac3f5ae78efd731095d0ba2dc3.tar.gz
irssi-scripts-e3e06d4e57388eac3f5ae78efd731095d0ba2dc3.zip
vim_mode: Fix r with count.
Diffstat (limited to 'vim-mode/vim_mode.pl')
-rw-r--r--vim-mode/vim_mode.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 50792dd..d01c5dc 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -985,9 +985,13 @@ sub cmd_movement_r {
my ($count, $pos, $repeat, $char) = @_;
my $input = _input();
- substr $input, $pos, 1, $char;
+
+ # Abort if at end of the line.
+ return (undef, undef) if length($input) < $pos + $count;
+
+ substr $input, $pos, $count, $char x $count;
_input($input);
- return (undef, $pos);
+ return (undef, $pos + $count - 1);
}
sub cmd_movement_p {