home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.2.144 < prev    next >
Encoding:
Internet Message Format  |  2003-11-01  |  6.9 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.144
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.2.144
  11. Problem:    When "g:html_use_css" is set the HTML header generated by the
  12.         2html script is wrong.
  13. Solution:   Add the header after adding HREF for links.
  14.         Also use ":normal!" instead of ":normal" to avoid mappings
  15.         getting in the way.
  16. Files:        runtime/syntax/2html.vim
  17.  
  18.  
  19. *** ../vim-6.2.143/runtime/syntax/2html.vim    Sat May 31 20:59:11 2003
  20. --- runtime/syntax/2html.vim    Sun Nov  2 17:44:26 2003
  21. ***************
  22. *** 1,6 ****
  23.   " Vim syntax support file
  24.   " Maintainer: Bram Moolenaar <Bram@vim.org>
  25. ! " Last Change: 2003 May 31
  26.   "           (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>)
  27.   
  28.   " Transform a file into HTML, using the current syntax highlighting.
  29. --- 1,6 ----
  30.   " Vim syntax support file
  31.   " Maintainer: Bram Moolenaar <Bram@vim.org>
  32. ! " Last Change: 2003 Nov 02
  33.   "           (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>)
  34.   
  35.   " Transform a file into HTML, using the current syntax highlighting.
  36. ***************
  37. *** 180,205 ****
  38.   let s:old_magic = &magic
  39.   set magic
  40.   
  41. - " The DTD
  42. - if exists("html_use_css")
  43. -   exe "normal a<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n    \"http://www.w3.org/TR/html4/strict.dtd\">\n\e"
  44. - endif
  45.   " HTML header, with the title and generator ;-). Left free space for the CSS,
  46.   " to be filled at the end.
  47. ! exe "normal a<html>\n<head>\n<title>\e"
  48. ! exe "normal a" . expand("%:p:~") . "</title>\n\e"
  49. ! exe "normal a<meta name=\"Generator\" content=\"Vim/" . version/100 . "." . version %100 . "\">\n\e"
  50.   if s:html_encoding != ""
  51. !   exe "normal a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . "\">\n\e"
  52.   endif
  53.   if exists("html_use_css")
  54. !   exe "normal a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
  55.   endif
  56.   if exists("html_no_pre")
  57. !   exe "normal a</head>\n<body>\n\e"
  58.   else
  59. !   exe "normal a</head>\n<body>\n<pre>\n\e"
  60.   endif
  61.   
  62.   wincmd p
  63. --- 180,200 ----
  64.   let s:old_magic = &magic
  65.   set magic
  66.   
  67.   " HTML header, with the title and generator ;-). Left free space for the CSS,
  68.   " to be filled at the end.
  69. ! exe "normal! a<html>\n<head>\n<title>\e"
  70. ! exe "normal! a" . expand("%:p:~") . "</title>\n\e"
  71. ! exe "normal! a<meta name=\"Generator\" content=\"Vim/" . version/100 . "." . version %100 . "\">\n\e"
  72.   if s:html_encoding != ""
  73. !   exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . "\">\n\e"
  74.   endif
  75.   if exists("html_use_css")
  76. !   exe "normal! a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
  77.   endif
  78.   if exists("html_no_pre")
  79. !   exe "normal! a</head>\n<body>\n\e"
  80.   else
  81. !   exe "normal! a</head>\n<body>\n<pre>\n\e"
  82.   endif
  83.   
  84.   wincmd p
  85. ***************
  86. *** 281,295 ****
  87.     if exists("html_no_pre")
  88.       let s:new = substitute(s:new, '  ', '\ \ ', 'g') . '<br>'
  89.     endif
  90. !   exe "normal \<C-W>pa" . strtrans(s:new) . "\n\e\<C-W>p"
  91.     let s:lnum = s:lnum + 1
  92.     +
  93.   endwhile
  94.   " Finish with the last line
  95.   if exists("html_no_pre")
  96. !   exe "normal \<C-W>pa\n</body>\n</html>\e"
  97.   else
  98. !   exe "normal \<C-W>pa</pre>\n</body>\n</html>\e"
  99.   endif
  100.   
  101.   
  102. --- 276,290 ----
  103.     if exists("html_no_pre")
  104.       let s:new = substitute(s:new, '  ', '\ \ ', 'g') . '<br>'
  105.     endif
  106. !   exe "normal! \<C-W>pa" . strtrans(s:new) . "\n\e\<C-W>p"
  107.     let s:lnum = s:lnum + 1
  108.     +
  109.   endwhile
  110.   " Finish with the last line
  111.   if exists("html_no_pre")
  112. !   exe "normal! \<C-W>pa\n</body>\n</html>\e"
  113.   else
  114. !   exe "normal! \<C-W>pa</pre>\n</body>\n</html>\e"
  115.   endif
  116.   
  117.   
  118. ***************
  119. *** 313,324 ****
  120.   " incorrect.
  121.   if exists("html_use_css")
  122.     if exists("html_no_pre")
  123. !     execute "normal A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: Courier, monospace; }\e"
  124.     else
  125. !     execute "normal A\npre { color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
  126.       yank
  127.       put
  128. !     execute "normal ^cwbody\e"
  129.     endif
  130.   else
  131.     if exists("html_no_pre")
  132. --- 308,319 ----
  133.   " incorrect.
  134.   if exists("html_use_css")
  135.     if exists("html_no_pre")
  136. !     execute "normal! A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: Courier, monospace; }\e"
  137.     else
  138. !     execute "normal! A\npre { color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
  139.       yank
  140.       put
  141. !     execute "normal! ^cwbody\e"
  142.     endif
  143.   else
  144.     if exists("html_no_pre")
  145. ***************
  146. *** 331,337 ****
  147.   " Line numbering attributes
  148.   if s:numblines
  149.     if exists("html_use_css")
  150. !     execute "normal A\n.lnr { " . s:CSS1(hlID("LineNr")) . "}\e"
  151.     else
  152.       execute '%s+<span class="lnr">\([^<]*\)</span>+' . s:HtmlOpening(hlID("LineNr")) . '\1' . s:HtmlClosing(hlID("LineNr")) . '+g'
  153.     endif
  154. --- 326,332 ----
  155.   " Line numbering attributes
  156.   if s:numblines
  157.     if exists("html_use_css")
  158. !     execute "normal! A\n.lnr { " . s:CSS1(hlID("LineNr")) . "}\e"
  159.     else
  160.       execute '%s+<span class="lnr">\([^<]*\)</span>+' . s:HtmlOpening(hlID("LineNr")) . '\1' . s:HtmlClosing(hlID("LineNr")) . '+g'
  161.     endif
  162. ***************
  163. *** 350,356 ****
  164.     " its occurences to make the HTML shorter
  165.     if s:attr != ""
  166.       if exists("html_use_css")
  167. !       execute "normal A\n." . s:id_name . " { " . s:attr . "}"
  168.       else
  169.         execute '%s+<span class="' . s:id_name . '">\([^<]*\)</span>+' . s:HtmlOpening(s:id) . '\1' . s:HtmlClosing(s:id) . '+g'
  170.       endif
  171. --- 345,351 ----
  172.     " its occurences to make the HTML shorter
  173.     if s:attr != ""
  174.       if exists("html_use_css")
  175. !       execute "normal! A\n." . s:id_name . " { " . s:attr . "}"
  176.       else
  177.         execute '%s+<span class="' . s:id_name . '">\([^<]*\)</span>+' . s:HtmlOpening(s:id) . '\1' . s:HtmlClosing(s:id) . '+g'
  178.       endif
  179. ***************
  180. *** 361,367 ****
  181.   endwhile
  182.   
  183.   " Add hyperlinks
  184. ! %s+\(http://\S\{-}\)\(\([.,;:]\=\(\s\|$\)\)\|[\\"'<>]\)+<A HREF="\1">\1</A>\2+ge
  185.   
  186.   " Cleanup
  187.   %s:\s\+$::e
  188. --- 356,367 ----
  189.   endwhile
  190.   
  191.   " Add hyperlinks
  192. ! %s+\(http://\S\{-}\)\(\([.,;:]\=\(\s\|$\)\)\|[\\"'<>]\|>\|<\)+<A HREF="\1">\1</A>\2+ge
  193. ! " The DTD
  194. ! if exists("html_use_css")
  195. !   exe "normal! ggi<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\e"
  196. ! endif
  197.   
  198.   " Cleanup
  199.   %s:\s\+$::e
  200. *** ../vim-6.2.143/src/version.c    Sun Nov  2 15:49:56 2003
  201. --- src/version.c    Sun Nov  2 17:48:30 2003
  202. ***************
  203. *** 639,640 ****
  204. --- 639,642 ----
  205.   {   /* Add new patch number below this line */
  206. + /**/
  207. +     144,
  208.   /**/
  209.  
  210. -- 
  211. Violators can be fined, arrested or jailed for making ugly faces at a dog.
  212.         [real standing law in Oklahoma, United States of America]
  213.  
  214.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  215. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  216. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  217.  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
  218.