Sunday, July 6, 2014

Re: [BUG?] redir tromping yank register 0?

Tim Chase wrote:

> Can anyone reproduce the following, and if so, is this a bug?
>
> vim -u NONE -N
>
> (start vim with no .vimrc in 'nocompatible' mode)
>
> ihello<esc>
>
> (insert some text on the first line)
>
> Y
>
> (yank the line)
>
> :reg
>
> (correctly shows that "" and "0 contain the yanked line)
>
> :redir @"
>
> (redirect into the scratch register)
>
> :reg
>
> Hey, where did my 0 register go?! I expected the scratch register to
> get tromped, but not my yank register. I didn't do any yanking, and
> the help says """
>
> Numbered register 0 contains the text from the most recent yank
> command, unless the command specified another register with ["x].
>
> """
>
> It appears that ":redir @[a-z]" is somehow treated as a yank.

I can see the "0 register changed when redirecting to the "" register,
but not when redirecting to another register.

This behavior may not be exactly right, but changing it most likely
causes more trouble than it solves.

--
ARTHUR: Listen, old crone! Unless you tell us where we can buy a shrubbery,
my friend and I will ... we will say "Ni!"
CRONE: Do your worst!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment