aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode/vim_mode.pl
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-09-29 15:01:39 +0000
committerSimon Ruderich <simon@ruderich.org>2010-09-29 15:02:08 +0000
commit9fdaf81e05d7cb799bfc24a76b14134a51ce785d (patch)
tree59c918d2c82edfc35a6ac142af086fd2e388426e /vim-mode/vim_mode.pl
parentvim_mode: Only allow access to registers a-z and " * +. (diff)
downloadirssi-scripts-9fdaf81e05d7cb799bfc24a76b14134a51ce785d.tar.gz
irssi-scripts-9fdaf81e05d7cb799bfc24a76b14134a51ce785d.zip
vim_mode: Add :reg[isters] and :di[splay] ex commands.
Diffstat (limited to '')
-rw-r--r--vim-mode/vim_mode.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 63d51ca..6f5a70a 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -820,6 +820,21 @@ sub cmd_ex_command {
$item->set_active();
}
}
+
+ # :reg[isters] {arg} and :di[splay] {arg}
+ } elsif ($arg_str =~ /^(?:reg(?:isters)?|di(?:splay)?)(?:\s+(.+)$)?/) {
+ my @regs;
+ if ($1) {
+ @regs = split //, $1 =~ s/\s+//g;
+ } else {
+ @regs = keys %$registers;
+ }
+ my $window = Irssi::active_win;
+ foreach my $key (sort @regs) {
+ if (defined $registers->{$key}) {
+ $window->print("register $key: $registers->{$key}");
+ }
+ }
}
}