Hi,

How do you think putting the name of syntax into html file generated by TOhtml?
Following patch does it.

Please, include the patch to the official source tree if appreciated.

Regards,
Masatake YAMATO


diff -uN /usr/share/vim/vim72/syntax/2html.vim ./2html.vim 
--- /usr/share/vim/vim72/syntax/2html.vim       2010-03-26 08:23:34.000000000 
+0900
+++ ./2html.vim 2010-07-15 19:16:25.991530652 +0900
@@ -191,6 +191,11 @@
 let s:old_et = &l:et
 let s:old_report = &report
 let s:old_search = @/
+if exists("b:current_syntax")
+  let s:old_syntax = b:current_syntax
+else
+  let s:old_syntax = "NONE"
+endif
 set notitle noicon
 setlocal et
 set report=1000000
@@ -247,6 +252,8 @@
 exe "normal! a<html>\n\e"
 exe "normal! a<head>\n<title>" . expand("%:p:~") . "</title>\n\e"
 exe "normal! a<meta name=\"Generator\" content=\"Vim/" . v:version/100 . "." . 
v:version %100 . '"' . s:tag_close . "\n\e"
+exe "normal! a<meta name=\"syntax\" content=\"" . s:old_syntax . '"' . 
s:tag_close . "\n\e"
+
 if s:html_encoding != ""
   exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; 
charset=" . s:html_encoding . '"' . s:tag_close . "\n\e"
 endif
@@ -543,4 +550,4 @@
     delfunc s:HtmlClosing
   endif
 endif
-silent! unlet s:diffattr s:difffillchar s:foldfillchar s:HtmlSpace 
s:LeadingSpace s:HtmlEndline
+silent! unlet s:diffattr s:difffillchar s:foldfillchar s:HtmlSpace 
s:LeadingSpace s:HtmlEndline s:old_syntax

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui