Reply to message «Re: PATCH: v:register value with 
clipboard=unnamed,unnamedplus», 
sent 23:31:40 04 February 2011, Friday
by Ingo Karkat:

There is one compatibility problem for empty v:register value: constructs like

    execute "normal! \"".v:register."yy"

won't work. If I was Bram, I would have dropped support for scripts that rely 
on 
my bugs (difference between documentation and actual behavior is a bug). Though 
there is another option: change documentation of v:register to mention that it 
is always an effective register and add v:regspecified variable.

Original message:
> On 16-Jan-2011 22:47, Ingo Karkat wrote:
> > I would propose changing the default value of v:register in case of
> > selection=unnamed from '"' to '*' (and correspondingly for
> > selection=unnamedplus to '+').
> 
> Any feedback about this and my accompanying "Startup value for v:register"
> patch? As I mentioned, this patch would fix currently broken behavior of
> plugins with selection=unnamed[plus] while keeping the main behavior of
> v:register as it has been since its introduction in Vim 6.2.
> 
> Alternatively, v:register could be changed so that it is empty when no
> register has been specified for that command, and rather make setreg() /
> getreg() handle the selection=unnamed setting when it is passed an empty
> register. This would be more like the current help text suggests, but in
> conflict with the existing implementation.
> 
> Actually, as a script developer, I would slightly prefer the second option,
> because it allows to detect whether a register was explicitly given; the
> current behavior is more that v:register always contains the effective
> register, regardless of whether it was given explicitly or the default
> register is used implicitly.
> 
> I could try my hand at implementing the second alternative, too, if that is
> preferred, but I would like to get some guidance and comments first.
> 
> -- regards, ingo

Attachment: signature.asc
Description: This is a digitally signed message part.

Raspunde prin e-mail lui