diff options
| author | Simon Ruderich <simon@ruderich.org> | 2010-10-02 15:44:00 +0000 | 
|---|---|---|
| committer | Simon Ruderich <simon@ruderich.org> | 2010-10-02 15:44:00 +0000 | 
| commit | e3e06d4e57388eac3f5ae78efd731095d0ba2dc3 (patch) | |
| tree | f380cb3f1c70a6ddfcde6b11fa5c13237e6d19f1 | |
| parent | vim_mode: Fix a with count. (diff) | |
| download | irssi-scripts-e3e06d4e57388eac3f5ae78efd731095d0ba2dc3.tar.gz irssi-scripts-e3e06d4e57388eac3f5ae78efd731095d0ba2dc3.zip | |
vim_mode: Fix r with count.
| -rw-r--r-- | vim-mode/vim_mode.pl | 8 | 
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 { | 
