Loading ...
Sorry, an error occurred while loading the content.

Patch 6.2.527

Expand Messages
  • Bram Moolenaar
    Patch 6.2.527 Problem: The 2html script uses :wincmd p , which breaks when using some autocommands. Solution: Remember the window numbers and jump to
    Message 1 of 1 , May 5, 2004
    • 0 Attachment
      Patch 6.2.527
      Problem: The 2html script uses ":wincmd p", which breaks when using some
      autocommands.
      Solution: Remember the window numbers and jump to them with ":wincmd w".
      Also add XHTML support. (Panagiotis Issaris)
      Files: runtime/syntax/2html.vim


      *** ../vim-6.2.526/runtime/syntax/2html.vim Mon Dec 29 20:49:00 2003
      --- runtime/syntax/2html.vim Wed May 5 11:17:45 2004
      ***************
      *** 1,7 ****
      " Vim syntax support file
      " Maintainer: Bram Moolenaar <Bram@...>
      ! " Last Change: 2003 Nov 13
      " (modified by David Ne\v{c}as (Yeti) <yeti@...>)

      " Transform a file into HTML, using the current syntax highlighting.

      --- 1,8 ----
      " Vim syntax support file
      " Maintainer: Bram Moolenaar <Bram@...>
      ! " Last Change: 2004 May 05
      " (modified by David Ne\v{c}as (Yeti) <yeti@...>)
      + " (XHTML support by Panagiotis Issaris <takis@...>)

      " Transform a file into HTML, using the current syntax highlighting.

      ***************
      *** 168,178 ****
      --- 169,183 ----
      set report=1000000

      " Split window to create a buffer with the HTML file.
      + let s:orgbufnr = winbufnr(0)
      if expand("%") == ""
      new Untitled.html
      else
      new %.html
      endif
      + let s:newwin = winnr()
      + let s:orgwin = bufwinnr(s:orgbufnr)
      +
      set modifiable
      %d
      let s:old_paste = &paste
      ***************
      *** 180,192 ****
      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<html>\n<head>\n<title>\e"
      exe "normal! a" . expand("%:p:~") . "</title>\n\e"
      ! exe "normal! a<meta name=\"Generator\" content=\"Vim/" . version/100 . "." . version %100 . "\">\n\e"
      if s:html_encoding != ""
      ! exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . "\">\n\e"
      endif
      if exists("html_use_css")
      exe "normal! a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
      --- 185,204 ----
      let s:old_magic = &magic
      set magic

      + if exists("use_xhtml")
      + exe "normal! a<?xml version=\"1.0\"?>\n\e"
      + let tag_close = '/>'
      + else
      + let tag_close = '>'
      + endif
      +
      " HTML header, with the title and generator ;-). Left free space for the CSS,
      " to be filled at the end.
      exe "normal! a<html>\n<head>\n<title>\e"
      exe "normal! a" . expand("%:p:~") . "</title>\n\e"
      ! exe "normal! a<meta name=\"Generator\" content=\"Vim/" . v:version/100 . "." . v:version %100 . '"' . tag_close . "\n\e"
      if s:html_encoding != ""
      ! exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . '"' . tag_close . "\n\e"
      endif
      if exists("html_use_css")
      exe "normal! a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
      ***************
      *** 197,203 ****
      exe "normal! a</head>\n<body>\n<pre>\n\e"
      endif

      ! wincmd p

      " List of all id's
      let s:idlist = ","
      --- 209,215 ----
      exe "normal! a</head>\n<body>\n<pre>\n\e"
      endif

      ! exe s:orgwin . "wincmd w"

      " List of all id's
      let s:idlist = ","
      ***************
      *** 274,290 ****
      endwhile

      if exists("html_no_pre")
      ! let s:new = substitute(s:new, ' ', '\ \ ', 'g') . '<br>'
      endif
      ! exe "normal! \<C-W>pa" . strtrans(s:new) . "\n\e\<C-W>p"
      let s:lnum = s:lnum + 1
      +
      endwhile
      " Finish with the last line
      if exists("html_no_pre")
      ! exe "normal! \<C-W>pa\n</body>\n</html>\e"
      else
      ! exe "normal! \<C-W>pa</pre>\n</body>\n</html>\e"
      endif


      --- 286,309 ----
      endwhile

      if exists("html_no_pre")
      ! if exists("use_xhtml")
      ! let s:new = substitute(s:new, ' ', '\ \ ', 'g') . '<br/>'
      ! else
      ! let s:new = substitute(s:new, ' ', '\ \ ', 'g') . '<br>'
      ! endif
      endif
      ! exe s:newwin . "wincmd w"
      ! exe "normal! a" . strtrans(s:new) . "\n\e"
      ! exe s:orgwin . "wincmd w"
      let s:lnum = s:lnum + 1
      +
      endwhile
      " Finish with the last line
      + exe s:newwin . "wincmd w"
      if exists("html_no_pre")
      ! exe "normal! a\n</body>\n</html>\e"
      else
      ! exe "normal! a</pre>\n</body>\n</html>\e"
      endif


      ***************
      *** 375,388 ****
      let &paste = s:old_paste
      let &magic = s:old_magic
      let @/ = s:old_search
      ! wincmd p
      let &l:et = s:old_et
      ! wincmd p

      ! " Save a little bit of memory (worths doing?)
      unlet s:old_et s:old_paste s:old_icon s:old_report s:old_title s:old_search
      unlet s:whatterm s:idlist s:lnum s:end s:fgc s:bgc s:old_magic
      unlet! s:col s:id s:attr s:len s:line s:new s:did_retab s:numblines
      delfunc s:HtmlColor
      delfunc s:CSS1
      if !exists("html_use_css")
      --- 394,408 ----
      let &paste = s:old_paste
      let &magic = s:old_magic
      let @/ = s:old_search
      ! exe s:orgwin . "wincmd w"
      let &l:et = s:old_et
      ! exe s:newwin . "wincmd w"

      ! " Save a little bit of memory (worth doing?)
      unlet s:old_et s:old_paste s:old_icon s:old_report s:old_title s:old_search
      unlet s:whatterm s:idlist s:lnum s:end s:fgc s:bgc s:old_magic
      unlet! s:col s:id s:attr s:len s:line s:new s:did_retab s:numblines
      + unlet s:orgwin s:newwin s:orgbufnr
      delfunc s:HtmlColor
      delfunc s:CSS1
      if !exists("html_use_css")
      *** ../vim-6.2.526/src/version.c Tue May 4 21:16:25 2004
      --- src/version.c Wed May 5 11:15:10 2004
      ***************
      *** 639,640 ****
      --- 642,645 ----
      { /* Add new patch number below this line */
      + /**/
      + 527,
      /**/

      --
      Corduroy pillows: They're making headlines!

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.