Hello,
according to :h quote_quote [*] the unnamed register (") should contain the
text deleted or yanked by the last "d", "c", "s", "x" or "y" command. There is
especialy mentioned that the text stored to the unnamed register does not
depend on the fact that a specific register was used (e.g. "xdd).
However, this is not true when using upper-case registers (those which
accumulate the text). The unnamed register contains the whole text of the
upper-case one, not only the one deleted or yanked by the last command.
Note that there is no exception mentioned even in the help for upper-case
registers.
Example:
consider a three line file (last line empty):
Hi
Hello
Then do: gg"ay$j"Ay$jp
(in English: yank the text of first line to register 'a', go to the second
line, add the text of that line to register 'a' by using upper-case name 'A',
go to the third (empty) line and put the content of unnamed register there.)
You can see 'HiHello' as a result but just 'Hello' was expected, according to
both common sense and the documentation. 'HiHello' should be in register 'a'
only.
Unfortunately I don't have plain 'vi' here so I don't know how it behaves in
the same situation. But at least the vim behaviour or documentation is not
correct. And, if possible, I vote for the behaviour from documentation, of
course.
Milan Vancura, Prague, Czech Republic, Europe
*) 1. Unnamed register "" *quote_quote* *quotequote*
Vim fills this register with text deleted with the "d", "c", "s", "x" commands
or copied with the yank "y" command, regardless of whether or not a specific
register was used (e.g. "xdd). This is like the unnamed register is pointing
to the last used register. An exception is the '_' register: "_dd does not
store the deleted text in any register.
Vim uses the contents of the unnamed register for any put command (p or P)
which does not specify a register. Additionally you can access it with the
name '"'. This means you have to type two double quotes. Writing to the ""
register writes to register "0.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---