diff options
-rw-r--r-- | vim-mode/vim_mode.pl | 20 |
1 files 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). |