aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode/vim_mode.pl
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-10-03 01:42:28 +0000
committerSimon Ruderich <simon@ruderich.org>2010-10-03 01:42:28 +0000
commit55762316ddbed2986ac587e494c9189fe6051b14 (patch)
tree98879de207ba6ba63687b728f1c6702dc83e7f08 /vim-mode/vim_mode.pl
parentvim_mode: Hopefully fix undo positions. (diff)
downloadirssi-scripts-55762316ddbed2986ac587e494c9189fe6051b14.tar.gz
irssi-scripts-55762316ddbed2986ac587e494c9189fe6051b14.zip
vim_mode: Fix undo positions for text-objects.
Diffstat (limited to 'vim-mode/vim_mode.pl')
-rw-r--r--vim-mode/vim_mode.pl20
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).