From 55762316ddbed2986ac587e494c9189fe6051b14 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 3 Oct 2010 03:42:28 +0200 Subject: vim_mode: Fix undo positions for text-objects. --- vim-mode/vim_mode.pl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 0e665e6..51c4c0b 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -1671,16 +1671,6 @@ sub handle_command_cmd { my $cur_pos = _input_pos(); - # Update input position of last undo entry so that undo/redo - # restores correct position. - if (@undo_buffer and _input() eq $undo_buffer[0]->[0] and - (defined $operator or exists $movements_repeatable->{$char} or - $char eq '.')) { - print "Updating history position: $undo_buffer[0]->[0]" - if DEBUG; - $undo_buffer[0]->[1] = $cur_pos; - } - # If defined $cur_pos will be changed to this. my $old_pos; # Position after the move. @@ -1713,6 +1703,16 @@ sub handle_command_cmd { $new_pos = _input_pos(); } + # Update input position of last undo entry so that undo/redo + # restores correct position. + if (@undo_buffer and _input() eq $undo_buffer[0]->[0] and + (defined $operator or exists $movements_repeatable->{$char} or + $char eq '.')) { + print "Updating history position: $undo_buffer[0]->[0]" + if DEBUG; + $undo_buffer[0]->[1] = $cur_pos; + } + # If we have an operator pending then run it on the handled text. # But only if the movement changed the position (this prevents # problems with e.g. f when the search string doesn't exist). -- cgit v1.2.3