]> granicus.if.org Git - vim/commitdiff
Improved :TOhtml. (Benjamin Fritz)
authorBram Moolenaar <Bram@vim.org>
Sun, 18 Jul 2010 12:07:22 +0000 (14:07 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 18 Jul 2010 12:07:22 +0000 (14:07 +0200)
runtime/autoload/tohtml.vim
runtime/plugin/tohtml.vim
runtime/syntax/2html.vim

index e929db325559e70990db8bb1c19b670b912f8b1f..6c03ecb340e03d54249d7b8358e43f41209abcfe 100644 (file)
@@ -1,14 +1,14 @@
 " Vim autoload file for the tohtml plugin.
 " Maintainer: Ben Fritz <fritzophrenic@gmail.com>
-" Last Change: 2010 Jul 15
+" Last Change: 2010 July 16
 "
 " Additional contributors:
 "
-"             Original by Bram Moolenaar <Bram@vim.org>
-"             Diff2HTML() added by Christian Brabandt <cb@256bit.org>
+"            Original by Bram Moolenaar <Bram@vim.org>
+"            Diff2HTML() added by Christian Brabandt <cb@256bit.org>
 "
-"             See Mercurial change logs for more!
+"            See Mercurial change logs for more!
+
 " this file uses line continuations
 let s:cpo_sav = &cpo
 set cpo-=C
@@ -142,27 +142,27 @@ func! tohtml#Diff2HTML(win_list, buf_list)
     " if dynamic folding is active.
     if exists("g:html_dynamic_folds")
       call append(style_start, [
-            \  "<script type='text/javascript'>",
-            \  "  <!--",
-            \  "  function toggleFold(objID)",
-            \  "  {",
-            \  "    for (win_num = 1; win_num <= 2; win_num++)",
-            \  "    {",
-            \  "      var fold;",
-            \  '      fold = document.getElementById("win"+win_num+objID);',
-            \  "      if(fold.className == 'closed-fold')",
-            \  "      {",
-            \  "        fold.className = 'open-fold';",
-            \  "      }",
-            \  "      else if (fold.className == 'open-fold')",
-            \  "      {",
-            \  "        fold.className = 'closed-fold';",
-            \  "      }",
-            \  "    }",
-            \  "  }",
-            \  "  -->",
-            \  "</script>"
-            \ ])
+           \  "<script type='text/javascript'>",
+           \  "  <!--",
+           \  "  function toggleFold(objID)",
+           \  "  {",
+           \  "    for (win_num = 1; win_num <= ".len(a:buf_list)."; win_num++)",
+           \  "    {",
+           \  "      var fold;",
+           \  '      fold = document.getElementById("win"+win_num+objID);',
+           \  "      if(fold.className == 'closed-fold')",
+           \  "      {",
+           \  "        fold.className = 'open-fold';",
+           \  "      }",
+           \  "      else if (fold.className == 'open-fold')",
+           \  "      {",
+           \  "        fold.className = 'closed-fold';",
+           \  "      }",
+           \  "    }",
+           \  "  }",
+           \  "  -->",
+           \  "</script>"
+           \ ])
     endif
 
     " Insert styles from all the generated html documents and additional styles
@@ -172,16 +172,16 @@ func! tohtml#Diff2HTML(win_list, buf_list)
     " is pretty useless for really long lines.
     if exists("g:html_use_css")
       call append(style_start, [
-            \ '<style type="text/css">']+
-            \  style+[
-            \ '<!--',
-            \ 'table { table-layout: fixed; }',
-            \ 'html, body, table, tbody { width: 100%; margin: 0; padding: 0; }',
-            \ 'th, td { width: '.printf("%.1f",100.0/len(a:win_list)).'%; }',
-            \ 'td div { overflow: auto; }',
-            \ '-->',
-            \  '</style>'
-            \ ])
+           \ '<style type="text/css">']+
+           \  style+[
+           \ '<!--',
+           \ 'table { table-layout: fixed; }',
+           \ 'html, body, table, tbody { width: 100%; margin: 0; padding: 0; }',
+           \ 'th, td { width: '.printf("%.1f",100.0/len(a:win_list)).'%; }',
+           \ 'td div { overflow: auto; }',
+           \ '-->',
+           \  '</style>'
+           \ ])
     endif
   endif
 endfunc
@@ -239,4 +239,4 @@ let &cpo = s:cpo_sav
 unlet s:cpo_sav
 
 " Make sure any patches will probably use consistent indent
-"   vim: sw=2 sts=2 et
+"   vim: ts=8 sw=2 sts=2 noet
index 3a6ae457b67db96e172c4ff3295f72817171d2d3..23cfd58d8abd6bedc5b2accd580bf9c27fbade93 100644 (file)
@@ -1,6 +1,6 @@
 " Vim plugin for converting a syntax highlighted file to HTML.
 " Maintainer: Ben Fritz <fritzophrenic@gmail.com>
-" Last Change: 2010 Jul 15
+" Last Change: 2010 Jul 16
 "
 " The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and
 " $VIMRUNTIME/syntax/2html.vim
@@ -14,4 +14,4 @@ if !&cp && !exists(":TOhtml") && has("user_commands")
 endif
 
 " Make sure any patches will probably use consistent indent
-"   vim: ts=2 sw=2 sts=2 et
+"   vim: ts=8 sw=2 sts=2 noet
index ab1c807f54ddffac97f9c23795215b129a6a83ae..d57324f13e4e0b482b8fcb7624aaad9939311a88 100644 (file)
@@ -1,6 +1,6 @@
 " Vim syntax support file
 " Maintainer: Ben Fritz <fritzophrenic@gmail.com>
-" Last Change: 2010 July 15
+" Last Change: 2010 July 16
 "
 " Additional contributors:
 "
@@ -990,7 +990,7 @@ while !empty(s:idlist)
     endif
   else
     execute '%s+<span class="' . s:id_name . '">\([^<]*\)</span>+\1+ge'
-    if exists("s:html_use_css")
+    if exists("g:html_use_css")
       1;/<style type="text/+1
     endif
   endif
@@ -1088,4 +1088,4 @@ let &cpo = s:cpo_sav
 unlet! s:cpo_sav
 
 " Make sure any patches will probably use consistent indent
-"   vim: noet sw=2 sts=2
+"   vim: ts=8 sw=2 sts=2 noet