2html.vim expands tab character while converting.  But the result is not
correct when line contains double-wide character.
The attached patch fixes it.

-- 
Yukihiro Nakadaira - [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

*** 2html.vim.orig	2008-11-23 05:42:26.000000000 +0900
--- 2html.vim	2008-11-23 05:44:31.000000000 +0900
***************
*** 393,403 ****
  
        " Expand tabs
        let s:expandedtab = strpart(s:line, s:startcol - 1, s:col - s:startcol)
!       let idx = stridx(s:expandedtab, "\t")
!       while idx >= 0
! 	let i = &ts - ((idx + s:startcol - 1) % &ts)
! 	let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', i), '')
! 	let idx = stridx(s:expandedtab, "\t")
        endwhile
  
        " Output the text with the same synID, with class set to {s:id_name}
--- 393,410 ----
  
        " Expand tabs
        let s:expandedtab = strpart(s:line, s:startcol - 1, s:col - s:startcol)
!       let s:idx = stridx(s:line, "\t", s:startcol - 1)
!       while s:idx >= 0 && s:idx < s:col - 1
! 	if s:idx == 0
! 	  let s:i = &ts
! 	else
! 	  let s:prevc = matchstr(s:line, '.\%' . (s:idx + 1) . 'c')
! 	  let s:vcol1 = virtcol([s:lnum, s:idx + 1 - len(s:prevc)])
! 	  let s:vcol2 = virtcol([s:lnum, s:idx + 1])
! 	  let s:i = s:vcol2 - s:vcol1
! 	endif
! 	let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', s:i), '')
! 	let s:idx = stridx(s:line, "\t", s:idx + 1)
        endwhile
  
        " Output the text with the same synID, with class set to {s:id_name}

Raspunde prin e-mail lui