From 4224a6ef673e337d7253043f9ade7f45785b1bcf Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Wed, 29 Sep 2010 23:42:52 +0200 Subject: vim_mode: Fix c to not delete the last space before a word. --- vim-mode/vim_mode.pl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vim-mode') 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); -- cgit v1.2.3