To: vim-dev@vim.org Subject: Patch 6.2.144 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.144 Problem: When "g:html_use_css" is set the HTML header generated by the 2html script is wrong. Solution: Add the header after adding HREF for links. Also use ":normal!" instead of ":normal" to avoid mappings getting in the way. Files: runtime/syntax/2html.vim *** ../vim-6.2.143/runtime/syntax/2html.vim Sat May 31 20:59:11 2003 --- runtime/syntax/2html.vim Sun Nov 2 17:44:26 2003 *************** *** 1,6 **** " Vim syntax support file " Maintainer: Bram Moolenaar ! " Last Change: 2003 May 31 " (modified by David Ne\v{c}as (Yeti) ) " Transform a file into HTML, using the current syntax highlighting. --- 1,6 ---- " Vim syntax support file " Maintainer: Bram Moolenaar ! " Last Change: 2003 Nov 02 " (modified by David Ne\v{c}as (Yeti) ) " Transform a file into HTML, using the current syntax highlighting. *************** *** 180,205 **** let s:old_magic = &magic set magic - " The DTD - if exists("html_use_css") - exe "normal a\n\e" - endif - " HTML header, with the title and generator ;-). Left free space for the CSS, " to be filled at the end. ! exe "normal a\n\n\e" ! exe "normal a" . expand("%:p:~") . "\n\e" ! exe "normal a\n\e" if s:html_encoding != "" ! exe "normal a\n\e" endif if exists("html_use_css") ! exe "normal a\n\e" endif if exists("html_no_pre") ! exe "normal a\n\n\e" else ! exe "normal a\n\n
\n\e"
  endif
  
  wincmd p
--- 180,200 ----
  let s:old_magic = &magic
  set magic
  
  " HTML header, with the title and generator ;-). Left free space for the CSS,
  " to be filled at the end.
! exe "normal! a\n\n\e"
! exe "normal! a" . expand("%:p:~") . "\n\e"
! exe "normal! a\n\e"
  if s:html_encoding != ""
!   exe "normal! a\n\e"
  endif
  if exists("html_use_css")
!   exe "normal! a\n\e"
  endif
  if exists("html_no_pre")
!   exe "normal! a\n\n\e"
  else
!   exe "normal! a\n\n
\n\e"
  endif
  
  wincmd p
***************
*** 281,295 ****
    if exists("html_no_pre")
      let s:new = substitute(s:new, '  ', '\ \ ', 'g') . '
' endif ! exe "normal \pa" . strtrans(s:new) . "\n\e\p" let s:lnum = s:lnum + 1 + endwhile " Finish with the last line if exists("html_no_pre") ! exe "normal \pa\n\n\e" else ! exe "normal \pa
\n\n\e" endif --- 276,290 ---- if exists("html_no_pre") let s:new = substitute(s:new, ' ', '\ \ ', 'g') . '
' endif ! exe "normal! \pa" . strtrans(s:new) . "\n\e\p" let s:lnum = s:lnum + 1 + endwhile " Finish with the last line if exists("html_no_pre") ! exe "normal! \pa\n\n\e" else ! exe "normal! \pa
\n\n\e" endif *************** *** 313,324 **** " incorrect. if exists("html_use_css") if exists("html_no_pre") ! execute "normal A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: Courier, monospace; }\e" else ! execute "normal A\npre { color: " . s:fgc . "; background-color: " . s:bgc . "; }\e" yank put ! execute "normal ^cwbody\e" endif else if exists("html_no_pre") --- 308,319 ---- " incorrect. if exists("html_use_css") if exists("html_no_pre") ! execute "normal! A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: Courier, monospace; }\e" else ! execute "normal! A\npre { color: " . s:fgc . "; background-color: " . s:bgc . "; }\e" yank put ! execute "normal! ^cwbody\e" endif else if exists("html_no_pre") *************** *** 331,337 **** " Line numbering attributes if s:numblines if exists("html_use_css") ! execute "normal A\n.lnr { " . s:CSS1(hlID("LineNr")) . "}\e" else execute '%s+\([^<]*\)+' . s:HtmlOpening(hlID("LineNr")) . '\1' . s:HtmlClosing(hlID("LineNr")) . '+g' endif --- 326,332 ---- " Line numbering attributes if s:numblines if exists("html_use_css") ! execute "normal! A\n.lnr { " . s:CSS1(hlID("LineNr")) . "}\e" else execute '%s+\([^<]*\)+' . s:HtmlOpening(hlID("LineNr")) . '\1' . s:HtmlClosing(hlID("LineNr")) . '+g' endif *************** *** 350,356 **** " its occurences to make the HTML shorter if s:attr != "" if exists("html_use_css") ! execute "normal A\n." . s:id_name . " { " . s:attr . "}" else execute '%s+\([^<]*\)+' . s:HtmlOpening(s:id) . '\1' . s:HtmlClosing(s:id) . '+g' endif --- 345,351 ---- " its occurences to make the HTML shorter if s:attr != "" if exists("html_use_css") ! execute "normal! A\n." . s:id_name . " { " . s:attr . "}" else execute '%s+\([^<]*\)+' . s:HtmlOpening(s:id) . '\1' . s:HtmlClosing(s:id) . '+g' endif *************** *** 361,367 **** endwhile " Add hyperlinks ! %s+\(http://\S\{-}\)\(\([.,;:]\=\(\s\|$\)\)\|[\\"'<>]\)+\1\2+ge " Cleanup %s:\s\+$::e --- 356,367 ---- endwhile " Add hyperlinks ! %s+\(http://\S\{-}\)\(\([.,;:]\=\(\s\|$\)\)\|[\\"'<>]\|>\|<\)+\1\2+ge ! ! " The DTD ! if exists("html_use_css") ! exe "normal! ggi\n\e" ! endif " Cleanup %s:\s\+$::e *** ../vim-6.2.143/src/version.c Sun Nov 2 15:49:56 2003 --- src/version.c Sun Nov 2 17:48:30 2003 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 144, /**/ -- Violators can be fined, arrested or jailed for making ugly faces at a dog. [real standing law in Oklahoma, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///