aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-09-29 22:27:36 +0000
committerSimon Ruderich <simon@ruderich.org>2010-09-29 22:27:36 +0000
commitae73ff808df9356552f231934612412281dc45e9 (patch)
tree922a45208c59a6cd628560ec37cb06b5021c9905 /vim-mode
parentvim_mode: Fix c to not delete the last space before a word. (diff)
downloadirssi-scripts-ae73ff808df9356552f231934612412281dc45e9.tar.gz
irssi-scripts-ae73ff808df9356552f231934612412281dc45e9.zip
vim_mode: Fix C not to move one character to the left.
Diffstat (limited to '')
-rw-r--r--vim-mode/vim_mode.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index bd15c2f..f7705ed 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -324,7 +324,8 @@ sub cmd_operator_c {
}
}
- cmd_operator_d($old_pos, $new_pos, $move, $repeat);
+ cmd_operator_d($old_pos, $new_pos, $move, $repeat, 1);
+
if (!$repeat) {
_update_mode(M_INS);
} else {
@@ -332,7 +333,7 @@ sub cmd_operator_c {
}
}
sub cmd_operator_d {
- my ($old_pos, $new_pos, $move, $repeat) = @_;
+ my ($old_pos, $new_pos, $move, $repeat, $change) = @_;
my ($pos, $length) = _get_pos_and_length($old_pos, $new_pos, $move);
@@ -348,8 +349,9 @@ sub cmd_operator_d {
}
_input($input);
- # Prevent moving after the text when we delete the last character.
- $pos-- if $pos == length($input);
+ # Prevent moving after the text when we delete the last character. But not
+ # when changing (C).
+ $pos-- if $pos == length($input) and !$change;
# Move the cursor at the right position.
_input_pos($pos);