Christian wrote:

> On So, 01 Jun 2014, Bram Moolenaar wrote:
> > When restoring clip_unnamed, it's not too dificult to set the
> > clipboard then.  Would require checking that it would have been set
> > (default register changed). Then the remarks about "doesn't work for
> > some commands" can be changed to "for some commands disabled until the
> > end". I'm sure this avoids surprises for users.
> 
> I am not sure how to do it.

This would require a flag, e.g. "did_set_selection".  When resetting
clip_unnamed before doing a global operation, this flag would be reset.
Then when text is deleted or yanked, clip_own_selection() will be
called, and if the register used matches the register that would be
associated with clip_unnamed, then set the "did_set_selection" flag.
When restoring clip_unnamed, check if "did_set_selection" was set, and
if it is call clip_own_selection() to get the current unnamed register
into the clipboard.

It's a bit sketchy, there are probably a few more details to work out,
but basically it would work to avoid putting text on the clipboard many
times and still end up with the correct clipboard contents in the end.
If we can make this work properly we can avoid users having to be aware
of this and just enjoy the much faster operation.


-- 
GALAHAD:   Camelot ...
LAUNCELOT: Camelot ...
GAWAIN:    It's only a model.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@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_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui