Monday, August 23, 2010

More information about the strange clipboard behaviour

Hi all :)

A time ago I posted a message about a problem I was having with the
clipboard and Vim 7.2. After updating to 7.3 I checked to see if the
problem had vanished.
I'm using console-only Vim 7.3-3, self compiled, under Ubuntu Linux
10.04 with X Window System.

Here is how I reproduce it:
- I selected and copied the text "David Gómez" from a GMail message
shown in Google Chrome. The problem only happens with that
combination, Google Chrome and Vim.
- From a terminal:
$ xclip -selection primary -o | od -Ax -tx1
000000 44 61 76 69 64 20 47 c3 b3 6d 65 7a
00000c
$ xclip -selection clipboard -o | od -Ax -tx1
000000 44 61 76 69 64 20 47 c3 b3 6d 65 7a
00000c

As you can see, both the primary and the clipboard selections have the
same text, the UTF-8 representation of "David Gómez".

Now, I paste the text into an empty "vim -u NONE", using "+po<ESC>"*p
and the screen shows this:
David Gómez
David Gómez
~
~
...

As you can see the first text is pasted incorrectly, the second,
correctly. Here is the output of ":registers"

--- Registers ---
"* David Gómez
"+ David Gómez

Again, it is shown that the "+" register is coded incorrectly.

After this, I tried to paste the default clipboard (that is, the one
that gets pasted usually with Ctrl-V) in many different applications
without any problem.
As shown by "xclip", both selections have exactly the same text, the
same bytes, but Vim is treating them differently.

Probably the problem is a Google Chrome one, but since only Vim shows
this behaviour I don't know what to think. If somebody could give me
another example of this problem (or reproduce it) I would be happy to
report the problem to the Google people.

Thanks!!

--
Raúl "DervishD" Núñez de Arenas Coronado
Linux Registered User 88736 | http://www.dervishd.net
The revolution will not be televised

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

No comments: