aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-09-26 20:35:37 +0000
committerSimon Ruderich <simon@ruderich.org>2010-09-26 20:35:37 +0000
commit7ed085ee686b1e022e47495ef3534532a07659dd (patch)
tree5c7aa8980478700ced113179d5d3cfa33bc87330 /vim-mode
parentvim_mode: Prepare for skipping of movements. (diff)
downloadirssi-scripts-7ed085ee686b1e022e47495ef3534532a07659dd.tar.gz
irssi-scripts-7ed085ee686b1e022e47495ef3534532a07659dd.zip
vim_mode: Implement skipping of movement/operator.
Used by . after startup.
Diffstat (limited to 'vim-mode')
-rw-r--r--vim-mode/vim_mode.pl14
1 files changed, 8 insertions, 6 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 141c836..1c67c0c 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -183,7 +183,7 @@ my $movements
'P' => { func => \&cmd_movement_P },
# misc
'~' => { func => \&cmd_movement_tilde },
- '.' => { func => \&cmd_movement_dot },
+ '.' => {},
};
# special movements which take an additional key
@@ -504,10 +504,6 @@ sub cmd_movement_tilde {
_input($input);
_input_pos($pos + $count);
}
-sub cmd_movement_dot {
- # Does nothing. Necessary to prevent errors when pressing . before running
- # any commands (at irssi startup).
-}
sub cmd_ex_command {
my $arg_str = join '', @ex_buf;
@@ -691,6 +687,8 @@ sub handle_command {
} elsif ($movement || exists $movements->{$char}) {
print "Processing movement command: $char" if DEBUG;
+ my $skip = 0;
+
# . repeats the last command.
if ($char eq '.' and !$movement and defined $last->{char}) {
$char = $last->{char};
@@ -700,9 +698,13 @@ sub handle_command {
}
$operator = $last->{operator};
$movement = $last->{movement};
+ } elsif ($char eq '.') {
+ $skip = 1;
}
- if (1) {
+ if ($skip) {
+ print "Skipping movement and operator." if DEBUG;
+ } else {
$numeric_prefix = 1 if not $numeric_prefix;
# Execute the movement (multiple times).