Sunday, January 22, 2012

Re: V""p vs Vp

On Sun, Jan 22, 2012 at 7:47 AM, John Beckett <johnb.beckett@gmail.com> wrote:
> David Fishburn wrote:
>> I am trying to figure out why I see different behaviour when
>> performing what I consider identical actions.
>
> Strange, I see that too (also with Vim 7.2.18).
> BTW the first "Shows 1" should be "Shows 2".
>
> The issue is as follows: start with two lines:
>
>    123
>    456
>
> 1. Press Y on the first line.
> 2. On the second line, press V then ""p
>   Result: No visible change (should have changed to "123").
> 3. Press Y on the first line.
> 4. On the second line, press V then p
>   Result: The second line is replaced with "123".
>
> After step 2, :echo @" shows 456 so Vim thinks the second line
> was changed, but it wasn't.
>
> The question is, what is ""p doing?
>
> John
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

If you replace text, the text replaced will first move to the unnamed
register, which is the very register you are pasting from. In steps:

1. Remove the text and place it in the register
2. Paste from the register

Of course this makes it impossible to replace any text! So my *guess*
is that there is a workaround for this somewhere in Vim. *Probably*
what is happening is that that workaround does not work when
specifically naming which register you are pasting from.


--
Albin Olsson, IT Consultant and Classic Connoisseur
www.albinolsson.se | albin.olsson@gmail.com
+46 707 831 830

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: