diff options
author | Simon Ruderich <simon@ruderich.org> | 2010-09-29 16:09:18 +0000 |
---|---|---|
committer | Simon Ruderich <simon@ruderich.org> | 2010-09-29 16:09:18 +0000 |
commit | b51bb6d7bfb522b37656638835fa6f00a13d189b (patch) | |
tree | d4b16084bc419c395cce67bf901c926ffcbd0fcf /vim-mode/vim_mode.pl | |
parent | vim_mode: Fix :registers/:display with arguments. (diff) | |
download | irssi-scripts-b51bb6d7bfb522b37656638835fa6f00a13d189b.tar.gz irssi-scripts-b51bb6d7bfb522b37656638835fa6f00a13d189b.zip |
vim_mode: Add support to append to registers (A-Z).
Diffstat (limited to 'vim-mode/vim_mode.pl')
-rw-r--r-- | vim-mode/vim_mode.pl | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index f801761..3cf1b7e 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -326,9 +326,15 @@ sub cmd_operator_d { # Remove the selected string from the input. my $input = _input(); - $registers->{$register} = substr $input, $pos, $length, ''; + my $string = substr $input, $pos, $length, ''; + if ($register =~ /[A-Z]/) { + $registers->{lc $register} .= $string; + print "Deleted into $register: ", $registers->{lc $register} if DEBUG; + } else { + $registers->{$register} = $string; + print "Deleted into $register: ", $registers->{$register} if DEBUG; + } _input($input); - print "Deleted into $register: " . $registers->{$register} if DEBUG; # Move the cursor at the right position. _input_pos($pos); @@ -340,8 +346,14 @@ sub cmd_operator_y { # Extract the selected string and put it in the " register. my $input = _input(); - $registers->{$register} = substr $input, $pos, $length; - print "Yanked into $register: " . $registers->{$register} if DEBUG; + my $string = substr $input, $pos, $length; + if ($register =~ /[A-Z]/) { + $registers->{lc $register} .= $string; + print "Yanked into $register: ", $registers->{lc $register} if DEBUG; + } else { + $registers->{$register} = $string; + print "Yanked into $register: ", $registers->{$register} if DEBUG; + } _input_pos($old_pos); } @@ -749,7 +761,7 @@ sub cmd_movement_tilde { sub cmd_movement_register { my ($count, $pos, $repeat, $char) = @_; - if (not exists $registers->{$char}) { + if (not exists $registers->{$char} and not exists $registers->{lc $char}) { print "Wrong register $char, ignoring." if DEBUG; return; } |