aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-10-01 14:40:52 +0000
committerSimon Ruderich <simon@ruderich.org>2010-10-01 14:40:52 +0000
commit40ef612ce45e0c8acd6e6a2183e7d4241a4b48df (patch)
tree227082909f6793afe63f126288259905c1aa57a1 /vim-mode
parentvim_mode: Update documentation. (diff)
downloadirssi-scripts-40ef612ce45e0c8acd6e6a2183e7d4241a4b48df.tar.gz
irssi-scripts-40ef612ce45e0c8acd6e6a2183e7d4241a4b48df.zip
vim_mode: Store repeatable "movements" in hash.
Diffstat (limited to 'vim-mode')
-rw-r--r--vim-mode/vim_mode.pl27
1 files changed, 20 insertions, 7 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 2b771b3..487779d 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -337,6 +337,24 @@ my $movements_multiple =
"\x17" => undef, # ctrl-w
};
+# "movements" which can be repeated (additional to operators of course).
+my $movements_repeatable
+ = {
+ 'x' => undef,
+ 'X' => undef,
+ 'r' => undef,
+ 'p' => undef,
+ 'P' => undef,
+ 'C' => undef,
+ 'D' => undef,
+ '~' => undef,
+ '"' => undef,
+ 'i' => undef,
+ 'a' => undef,
+ 'I' => undef,
+ 'A' => undef,
+ };
+
sub cmd_undo {
print "Undo!" if DEBUG;
@@ -1435,13 +1453,8 @@ sub handle_command_cmd {
$repeat);
}
- # Store command, necessary for . But ignore movements and
- # registers.
- if ($operator or $char eq 'x' or $char eq 'X' or $char eq 'r' or
- $char eq 'p' or $char eq 'P' or $char eq 'C' or
- $char eq 'D' or $char eq '~' or $char eq '"' or
- $char eq 'i' or $char eq 'I' or $char eq 'a' or
- $char eq 'A') {
+ # Store command, necessary for .
+ if ($operator or exists $movements_repeatable->{$char}) {
$last->{char} = $char;
$last->{numeric_prefix} = $numeric_prefix;
$last->{operator} = $operator;