From 79a1d6bc2fd48ee2d1e12e7e7728485ea8ee1267 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 26 Sep 2010 21:56:25 +0200 Subject: vim_mode: d/c copies deleted string to " register. --- vim-mode/vim_mode.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vim-mode') diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 04d614d..57cddef 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -202,8 +202,9 @@ sub cmd_operator_d { # Remove the selected string from the input. my $input = _input(); - substr $input, $pos, $length, ''; + $registers->{'"'} = substr $input, $pos, $length, ''; _input($input); + print "Deleted: " . $registers->{'"'} if DEBUG; # Move the cursor at the right position. _input_pos($pos); @@ -215,9 +216,8 @@ sub cmd_operator_y { # Extract the selected string and put it in the " register. my $input = _input(); - my $string = substr $input, $pos, $length; - $registers->{'"'} = $string; - print "Yanked: $string" if DEBUG; + $registers->{'"'} = substr $input, $pos, $length; + print "Yanked: " . $registers->{'"'} if DEBUG; _input_pos($old_pos); } -- cgit v1.2.3