zerowidth/vim-copy-as-rtf

RTF not Working

aokolovskis opened this issue · 7 comments

Hi,

whats the best way to debug this script. Currently im on a MAC OS 10.9.3 and
IM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 24 2013 18:58:47)
Compiled by root@apple.com.

The script copies the source but without RTF-Information.I tried to paste to Mac Office 2008 and TextEdit.
The TOhtml works as expected.

Best regards

What error are you seeing?

I don’t see any errors.

With MacVim, it works excellent.
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 25 2013 20:05:26)
MacOS X (unix) version=

What's it doing or not doing, then?

It copies the source code.
If I paste it into Mac Office, Mac Office displays it uncolored (black only), same with TextEdit.

Using vim (not macvim) locally:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled May 25 2014 16:07:44)
MacOS X (unix) version

Looks like RTF information is copied to the clipboard. It doesn't have the same colors as my 256-color vim theme, but it does have some color information.

I'd guess it's something in the TOhtml command that's not including all the colors. Try running :TOhtml on the code you're trying to copy, and make sure it generates some reasonable HTML. In particular, since you're not seeing color highlighting, check that the CSS rules generated in the HTML have color values set. Check that the rendered HTML looks correct when loaded as an html file in a browser, too. If it doesn't have colors there, it's probably TOhtml's fault for not including color information.

Do you have syntax highlighting in vim in the console? Far as I'm aware, TOhtml will use whatever color information it has available, and if there's no colors or if the colors are limited, it'll use what it's got.

I'd guess it's something in the TOhtml command that's not including all the colors. Try running :TOhtml on the code you're trying to copy, and make sure it generates some reasonable HTML. In particular, since you're not seeing color highlighting, check that the CSS rules generated in the HTML have color values set. Check that the rendered HTML looks correct when loaded as an html file in a browser, too. If it doesn't have colors there, it's probably TOhtml's fault for not including color information.

Do you have syntax highlighting in vim in the console? Far as I'm aware, TOhtml will use whatever color information it has available, and if there's no colors or if the colors are limited, it'll use what it's got.

Yes, that's it. The console "vim" displays the colors, but the TOhtml HTML is garbage....

Thanks a lot.

Ouch. Unfortunately that's a core vim plugin, not something I can help fix.

Try switching color schemes in terminal vim before doing the CopyRTF command though, I have a feeling that maybe some color themes are less complete when it comes to the terminal version.

In any case, for WYSIWYG output, it sounds like MacVim is the way to go.