aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode/vim_mode.pl
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-09-29 21:42:52 +0000
committerSimon Ruderich <simon@ruderich.org>2010-09-29 21:42:52 +0000
commit4224a6ef673e337d7253043f9ade7f45785b1bcf (patch)
tree3eec6f316ee21d0089cbd465d507d76210d6ddad /vim-mode/vim_mode.pl
parentvim_mode: Fix dB. (diff)
downloadirssi-scripts-4224a6ef673e337d7253043f9ade7f45785b1bcf.tar.gz
irssi-scripts-4224a6ef673e337d7253043f9ade7f45785b1bcf.zip
vim_mode: Fix c to not delete the last space before a word.
Diffstat (limited to 'vim-mode/vim_mode.pl')
-rw-r--r--vim-mode/vim_mode.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index eebe58b..bd15c2f 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -316,6 +316,14 @@ sub cmd_redo {
sub cmd_operator_c {
my ($old_pos, $new_pos, $move, $repeat) = @_;
+ # Changing a word or WORD doesn't delete the last space before a word.
+ if ($move eq 'w' or $move eq 'W') {
+ my $input = _input();
+ if (substr($input, $new_pos - 1, 1) =~ /\s/) {
+ $new_pos--;
+ }
+ }
+
cmd_operator_d($old_pos, $new_pos, $move, $repeat);
if (!$repeat) {
_update_mode(M_INS);