summaryrefslogtreecommitdiff
path: root/runtime/syntax/2html.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/syntax/2html.vim')
-rw-r--r--runtime/syntax/2html.vim17
1 files changed, 14 insertions, 3 deletions
diff --git a/runtime/syntax/2html.vim b/runtime/syntax/2html.vim
index d37ca1aa..6b22c81c 100644
--- a/runtime/syntax/2html.vim
+++ b/runtime/syntax/2html.vim
@@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
-" Last Change: 2011 Jan 06
+" Last Change: 2011 Apr 05
"
" Additional contributors:
"
@@ -33,6 +33,13 @@ endif
let s:settings = tohtml#GetUserSettings()
+" Whitespace
+if s:settings.pre_wrap
+ let s:whitespace = "white-space: pre-wrap; "
+else
+ let s:whitespace = ""
+endif
+
" When not in gui we can only guess the colors.
if has("gui_running")
let s:whatterm = "gui"
@@ -1048,10 +1055,14 @@ if s:settings.use_css
if s:settings.no_pre
execute "normal! A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: ". s:htmlfont ."; }\e"
else
- execute "normal! A\npre { font-family: ". s:htmlfont ."; color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
+ execute "normal! A\npre { " . s:whitespace . "font-family: ". s:htmlfont ."; color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
yank
put
execute "normal! ^cwbody\e"
+ " body should not have the wrap formatting, only the pre section
+ if s:whitespace != ''
+ exec 's#'.s:whitespace
+ endif
endif
else
execute '%s:<body>:<body bgcolor="' . s:bgc . '" text="' . s:fgc . '">\r<font face="'. s:htmlfont .'">'
@@ -1160,7 +1171,7 @@ let &l:winfixheight = s:old_winfixheight
let &ls=s:ls
" Save a little bit of memory (worth doing?)
-unlet s:htmlfont
+unlet s:htmlfont s:whitespace
unlet s:old_et s:old_paste s:old_icon s:old_report s:old_title s:old_search
unlet s:old_magic s:old_more s:old_fdm s:old_fen s:old_winheight
unlet! s:old_isprint