On Sat, Apr 30, 2011 at 12:37 PM, Gary Johnson <[email protected]>
wrote:
>
> Copying and pasting seems to be working fine now.  I don't
> understand what problem this patch is supposed to fix.  If I knew
> what to look for, I would apply and test it.

Some clarification then:

On a vim compiled with X and xterm_clipboard, either

 * Copy an explicit linewise selection (via triple-click in your browser
   let's say) into the X PRIMARY or CLIPBOARD, then paste it into a vim
   buffer using "*p or "+p, while in the middle of an existing line.

 * Do a linewise yank with "+y. Then either quit vim, or duplicate the
   selection with a clipboard manager (e.g. with parcellite, simply
   click on the string you just yanked in the pull down menu). Try
   pasting the line again with "+p

You should notice that when pasting a linewise selection that has not
originated from vim, or that has been duplicated by another program, it
will be pasted in MCHAR mode (pasted inline) as opposed to MLINE mode
(pasted on next/prev line).

This came to my attention while working on a Mac in my X terminal with
the new `unnamedplus' feature enabled.  The Mac X11.app has a feature
that will sync the native clipboard with the X Clipboard, but in the
process, vim's native vimenc_atom format is replaced with the standard
X compound_text format.

Among other things, vimenc_atom stores the motion_type in the first byte
of the "format" member the of Atom struct, so the motion_type of the
original selection was lost. Performing a yyp would annoyingly repaste
the line after the current character, instead of opening a new line.

The vim[enc]_atom format seems to have been explicitly created to handle
this motion_type issue, and it works quite well. Linewise and blockwise
selections from even different vim processes paste perfectly across the
X CLIPBOARD.

This patch would just like address the small issue of pasting linewise
selections that are not in the vim[enc]_atom format, whether they
ultimately originate from vim, or from another program.

Blockwise selections, of course, cannot be distinguished from linewise
selections after the selection is converted into compound_text, but that
seems like a small issue since most applications do not allow blockwise
selections.

Cheers,
Sung Pae

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

Raspunde prin e-mail lui