aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode/vim_mode.pl
diff options
context:
space:
mode:
Diffstat (limited to 'vim-mode/vim_mode.pl')
-rw-r--r--vim-mode/vim_mode.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index c4719d7..63d51ca 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -180,11 +180,16 @@ my $mode = M_INS;
# current active register
my $register = '"';
-# vi registers, " is the default register
+# vi registers
my $registers
= {
- '"' => ''
+ '"' => '', # default register
+ '+' => '', # contains irssi's cut buffer
+ '*' => '', # same
};
+foreach my $char ('a' .. 'z') {
+ $registers->{$char} = '';
+}
# current imap still pending (first character entered)
my $imap = undef;
@@ -744,6 +749,11 @@ sub cmd_movement_tilde {
sub cmd_movement_register {
my ($count, $pos, $repeat, $char) = @_;
+ if (not exists $registers->{$char}) {
+ print "Wrong register $char, ignoring." if DEBUG;
+ return;
+ }
+
# + and * contain both irssi's cut-buffer
if ($char eq '+' or $char eq '*') {
$registers->{'+'} = Irssi::parse_special('$U');