Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv3710
Modified Files:
packages.vim
Log Message:
Bug: When a \usepackage{} line is inside a fold, then we go into an
infinite loop. (Lin-bo Zhang)
Cause: Due to an apparent vim bug, when if we issue the command
/somepattern
in a closed fold, then we always goto the first match in the fold.
Solution: A temporary hack of first opening up all folds before scanning
and then closing them. This needs to be robustified in the future
using mkview.vim
Index: packages.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** packages.vim 13 Jun 2003 21:41:27 -0000 1.33
--- packages.vim 16 Jun 2003 06:40:00 -0000 1.34
***************
*** 202,206 ****
0
! " Scan
while search('^\s*\\usepackage\_.\{-}{\_.\+}', 'W')
--- 202,210 ----
0
! " Scan the file. First open up all the folds, because the command
! " /somepattern
! " issued in a closed fold _always_ goes to the first match.
! normal! ggVGzO
!
while search('^\s*\\usepackage\_.\{-}{\_.\+}', 'W')
***************
*** 228,232 ****
" \usepackage{stuff,foo} into @a. Do not use matchstr() and the like
" because we can have things split across lines and such.
! exec "normal! /{\<CR>\"ayi}"
" now remove all whitespace from @a. We need to remove \n and \r
--- 232,236 ----
" \usepackage{stuff,foo} into @a. Do not use matchstr() and the like
" because we can have things split across lines and such.
! exec "normal! /{\<CR>\"ay/}\<CR>"
" now remove all whitespace from @a. We need to remove \n and \r
***************
*** 261,267 ****
" restore @a
let @a = saveA
-
endwhile
" Because creating list of detected packages gives string
" ',pack1,pack2,pack3' remove leading ,
--- 265,275 ----
" restore @a
let @a = saveA
endwhile
+ " TODO: This needs to be changed. In the future, we might have
+ " functionality to remember the fold-state before opening up all the folds
+ " and then re-creating them. Use mkview.vim.
+ normal! ggVGzC
+
" Because creating list of detected packages gives string
" ',pack1,pack2,pack3' remove leading ,
***************
*** 325,328 ****
--- 333,337 ----
let userpackage = Tex_Strntok(tpd_orig, ',', fn)
let stypath = expand("%:p:h").'/'.userpackage.'.sty'
+ call Tex_Debug('userpackage = '.userpackage.', stypath = '.stypath, 'pack')
" If package with given name exists in current dir
|