[Vim-latex-cvs] vimfiles/ftplugin/tex texviewer.vim,1.17,1.18
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2003-06-07 21:02:27
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv24873 Modified Files: texviewer.vim Log Message: Bug: <F9> did not work with the following \includegraphics[0.8\columnwidth]{} because the regexp thought that s:type = '\columnwidth]' Improved the regexp to account for commands within options. Still not tested extensively, but should be better than before. Bug: "wincmd q" does not always seem to work from within the script (this is a vim bug). replace with q which seems more reliable. Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** texviewer.vim 7 Jun 2003 10:39:24 -0000 1.17 --- texviewer.vim 7 Jun 2003 21:02:23 -0000 1.18 *************** *** 63,69 **** let s:curline = strpart(getline('.'), col('.') - 40, 40) let s:prefix = matchstr(s:curline, '.*{\zs.\{-}$') ! let s:type = matchstr(s:curline, '.*\\\zs.\{-}\ze{.\{-}$') ! let s:typeoption = matchstr(s:type, '\zs[.*]\ze') ! let s:type = substitute(s:type, '[.*', '', 'e') if exists("s:type") && s:type =~ 'ref' --- 63,77 ---- let s:curline = strpart(getline('.'), col('.') - 40, 40) let s:prefix = matchstr(s:curline, '.*{\zs.\{-}$') ! " a command is of the type ! " \includegraphics[0.8\columnwidth]{} ! " Thus ! " s:curline = '\includegraphics[0.8\columnwidth]{' ! " (with possibly some junk before \includegraphics) ! " from which we need to extract ! " s:type = 'includegraphics' ! " s:typeoption = '[0.8\columnwidth]' ! let pattern = '.*\\\(\w\{-}\)\(\[.\{-}\]\)\?{$' ! let s:type = substitute(s:curline, pattern, '\1', 'e') ! let s:typeoption = substitute(s:curline, pattern, '\2', 'e') if exists("s:type") && s:type =~ 'ref' *************** *** 332,339 **** cclose elseif a:type =~ 'expl_ext\|expl_noext' ! wincmd q endif exe s:pos " Complete word, check if add closing } --- 340,348 ---- cclose elseif a:type =~ 'expl_ext\|expl_noext' ! q endif exe s:pos + " Complete word, check if add closing } |