1 --- /usr/share/vim/vim73/syntax/2html.vim 2010-08-28 18:59:26.000000000 +0000
2 +++ /home/andy/.vim/syntax/2html.vim 2010-08-31 04:34:00.000000000 +0000
5 let s:settings = tohtml#GetUserSettings()
9 + let s:whitespace = "white-space: pre-wrap; "
11 + let s:whitespace = ""
14 " When not in gui we can only guess the colors.
16 let s:whatterm = "gui"
19 let s:old_more = &more
26 call add(s:lines, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . s:tag_close)
28 call extend(s:lines, [
29 - \ ("<title>".expand("%:p:~")."</title>"),
30 + \ ("<title>".&titlestring."</title>"),
31 \ ("<meta name=\"Generator\" content=\"Vim/".v:version/100.".".v:version%100.'"'.s:tag_close),
32 \ ("<meta name=\"plugin-version\" content=\"".g:loaded_2html_plugin.'"'.s:tag_close)
36 call extend(s:lines, ["</head>", "<body>"])
38 - call extend(s:lines, ["</head>", "<body>", "<pre>"])
39 + call extend(s:lines, ["</head>", "<body><pre>"])
42 exe s:orgwin . "wincmd w"
44 if s:settings.ignore_conceal || !s:concealinfo[0]
46 let s:expandedtab = strpart(s:line, s:startcol - 1, s:col - s:startcol)
49 let s:idx = stridx(s:expandedtab, "\t")
52 let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', s:i), '')
53 let s:idx = stridx(s:expandedtab, "\t")
59 " get the highlight group name to use
60 let s:id = synIDtrans(s:id)
63 if !s:settings.use_css
64 " Close off the font tag that encapsulates the whole <body>
65 - call extend(s:lines, ["</font>", "</body>", "</html>"])
66 + call extend(s:lines, ["</font></body></html>"])
68 - call extend(s:lines, ["</body>", "</html>"])
69 + call extend(s:lines, ["</body></html>"])
72 - call extend(s:lines, ["</pre>", "</body>", "</html>"])
73 + call extend(s:lines, ["</pre></body></html>"])
76 exe s:newwin . "wincmd w"
79 execute "normal! A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: ". s:htmlfont ."; }\e"
81 - execute "normal! A\npre { font-family: ". s:htmlfont ."; color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
82 + execute "normal! A\npre { " . s:whitespace . "font-family: ". s:htmlfont ."; color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
85 execute "normal! ^cwbody\e"
87 exec 'resize' s:old_winheight
88 let &l:winfixheight = s:old_winfixheight
90 -call setwinvar(s:orgwin,'&stl', s:origwin_stl)
91 -call setwinvar(s:newwin,'&stl', s:newwin_stl)
92 +"call setwinvar(s:orgwin,'&stl', s:origwin_stl)
93 +"call setwinvar(s:newwin,'&stl', s:newwin_stl)
96 " Save a little bit of memory (worth doing?)