Friday, October 12, 2012

Re: VimDiff printing - close but no cigar

Ben,


On 2012-10-13 04:13, Ben Fritz wrote:
> On Friday, October 12, 2012 11:15:51 AM UTC-5, Philip Rhoades wrote:
>> >>
>> >> The problem is that the files contain long lines - after the HTML
>> >> conversion, the long lines in the browser are viewable by using
>> the
>> >> scroll bars at the bottom of each panel but when printed, the
>> lines
>> >> are
>> >> truncated ie only the stuff on the screen with the scroll bars at
>> >> hard
>> >> left are printed.
>> >>
>> >
>> > Oh yuck. I don't know of a good way around that. Either you accept
>> > truncated lines, or you turn on word wrapping and risk a
>> misaligned
>> > diff. If you're lucky the diff will still align correctly and the
>> > word
>> > wrapping will solve your problem.
>>
>> I should have said - I did try that but the output in html is still
>> long lines.
>>
>> > Try converting again after doing a
>> > ":let g:html_pre_wrap=1". Normally it defaults to the same value
>> as
>> > your 'wrap' option, which is off for good reason during a diff,
>> but
>> > this will force it on.
>>
>> I still get long lines in the output . .
>
>
> If by "long lines in the output" you mean, you printed from your
> browser, and lines got truncated rather than wrapped, this is very
> surprising. This is a very simple feature and should work.


I do:

vimdiff file1.txt file2.txt
:se wrap
CTRL-w-w
:se wrap
:let g:html_pre_wrap=1
:TOhtml
ENTER
:w t.html
:q!
:q!
:q!
google-chrome ./t.html

but the long lines are still long and I have to use the scroll bars to
see the rest of the lines and when printed the lines are truncated after
the first ~80 chars.


> I just tested with a diff HTML file generated by Vim with long lines
> in the file.
>
> On Opera, the print preview shows wrapped lines regardless of the
> html_pre_wrap setting. In IE8 and Chrome, without html_pre_wrap, the
> long lines are truncated. With html_pre_wrap, the lines wrap as
> expected.


?? Am I doing something wrong above?


> What are you seeing? Can you attach some sample output, or at least
> the <meta> lines in the generated output?


<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1">
<title>diff</title>
<meta name="Generator" content="Vim/7.3">
<meta name="plugin-version" content="vim7.3_v6">
<meta name="settings" content="use_css,whole_filler">


> What version of what browser
> are you printing from?


google-chrome-stable-18.0.1025.162-131933.x86_64

Thanks,

Phil.

--
Philip Rhoades

GPO Box 3411
Sydney NSW 2001
Australia
E-mail: phil@pricom.com.au

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