Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 308927 - copy from Gvim & paste to OpenOffice fails with Gvim 7.2.303
Summary: copy from Gvim & paste to OpenOffice fails with Gvim 7.2.303
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-11 02:48 UTC by Philip Webb
Modified: 2010-06-08 03:31 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Webb 2010-03-11 02:48:34 UTC
After updating to Gvim 7.2.303 , copy-paste into OpenOffice 3.1.1 failed.
This is still the case with Gvim 7.2.376 & OpenOffice 3.2.0 .
Previously, there was no problem.

Reproducible: Always

Steps to Reproduce:
1. Open a file in Gvim.
2. Select some text, with or without the mouse & w/w/o 'y'.
3. Middle-click to paste into Open Office.

Actual Results:  
Nothing appears in the Open Office file.

Expected Results:  
Previously, the selected text was successfully copied into the OO file.

This happens only from Gvim to OpenOffice.
I can copy-paste from Gvim into Xterm, Konsole & the Xfce Terminal;
I can copy-paste from Vim running in those terminals into OpenOffice.
My desktop manager is Fluxbox-1.1.1-r1 .
Comment 1 Jim Ramsay (lack) (RETIRED) gentoo-dev 2010-06-03 13:14:44 UTC
This is truly weird, and I have no idea what's going on here.  The problem is still present in vim-7.2.416.

Do you happen to remember what version you were running before you upgraded to 7.2.303?
Comment 2 Jim Ramsay (lack) (RETIRED) gentoo-dev 2010-06-03 13:39:22 UTC
Aha, I have found the patch at fault: 7.2.201, so you most likely upgraded from 7.2.182

I have a workaround for you:

  :set cb=autoselect,html,exclude:cons\|linux

By including the 'html' in there, I can suddenly cut&paste into OpenOffice again.  But I believe you have found a bug in the way vim handles this pasting introduced by that patch.

I'm working on a more permanent fix.
Comment 3 Philip Webb 2010-06-04 00:52:09 UTC
Thanks: I've added your line to  ~/.vimrc  & can paste into Open Office again.  Please note that line breaks are not copied, only the text: is this a bug too ?
Comment 4 Jim Ramsay (lack) (RETIRED) gentoo-dev 2010-06-07 16:58:34 UTC
(In reply to comment #3)
> Thanks: I've added your line to  ~/.vimrc  & can paste into Open Office again. 
> Please note that line breaks are not copied, only the text: is this a bug too ?

Actually that's an expected result of having 'html' in your 'cb' variable: OpenOffice thinks the text you are pasting from vim is html, so it will collapse all linebreaks, extra spaces, etc... And if you happen to be copying real HTML, it will actually interpret the tags into actual OpenOffice attributes, like <li> into bullets, <b>...</b> into bold text, etc.  The case for plain text is ugly because of the whitespace squashing, but better than no cut&paste at all.

But I have even better news as of today -> There's a real fix available for this.  As I was investigating the best way to actually solve this issue, I started a discussion on the vim-dev mailing list explaining the cause of the issue, and before I could write a single line of code, someone else came up with a patch and 7.2.442 was released with the fix in it.

I have just added vim-core/vim/gvim-7.2.442 to the Gentoo tree, and the fix works as advertised.  This is in unstable ~ARCH for now, so if you're running a stable system you'll have to unmask app-editors/vim-core-7.2.442 and app-editors/gvim-7.2.442 (and maybe app-editors/vim-7.2.442 if you have vim installed as well)

Remove that ':set cb...' line from your ~/.vimrc once you upgrade, and you'll be properly pasting plain text from gvim into OpenOffice just like before the last upgrade.

Enjoy!  And thanks for the bug report.
Comment 5 Philip Webb 2010-06-08 03:31:07 UTC
Thanks to you & the Vim devs for identifying & solving the problem.
I've updated to 442 , commented the temporary line in  ~/.vimrc
& copied chunks from a couple of files into OO with formatting retained.