From 0fce5db1b81aa23a18ce3596b42cbfdad42c88d6 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 3 Oct 2010 02:14:04 +0200 Subject: vim_mode: Only undo operators, repeatable movements and repetitions. --- vim-mode/vim_mode.pl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'vim-mode') diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 8a6a2ab..3982c93 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -1670,11 +1670,10 @@ sub handle_command_cmd { my $cur_pos = _input_pos(); - # save an undo checkpoint here. - - if ($char ne 'u' && $char ne "\x12" && $char ne "\x04" - && $char ne 'j' && $char ne 'k') { - + # Save an undo checkpoint here for operators, all repeatable + # movements, operators and repetition. + if (defined $operator or exists $movements_repeatable->{$char} or + $char eq '.') { # TODO: why do histpry entries still show up in undo # buffer? Is avoiding the commands here insufficient? -- cgit v1.2.3