aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode
diff options
context:
space:
mode:
Diffstat (limited to 'vim-mode')
-rw-r--r--vim-mode/vim_mode.pl3
1 files changed, 3 insertions, 0 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index acc4f26..847ce6e 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -340,6 +340,9 @@ sub cmd_operator_d {
}
_input($input);
+ # Prevent moving after the text when we delete the last character.
+ $pos-- if $pos == length($input);
+
# Move the cursor at the right position.
_input_pos($pos);
}