diff options
| -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 { | 
