Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv22609
Modified Files:
packages.vim
Log Message:
Bug: Use Tex_GetMainFileName(':p:r') to find the complete path-name of the
master file, not Tex_GetMainFileName(':p').
Change: Do not use the v:errmsg mechanism for finding out if an error
occured in opening a custom package. Sometimes, other errors could
occur _after_ the file is opened, causing v:errmsg to be corrupted.
Instead check to see using bufnr(), which should be more robust.
Change: Use silent! while opening and closing folds, otherwise we get
errors on terminal.
Index: packages.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** packages.vim 17 Jun 2003 02:07:47 -0000 1.35
--- packages.vim 18 Jun 2003 01:09:30 -0000 1.36
***************
*** 83,87 ****
" Find out which file we need to scan.
if Tex_GetMainFileName() != ''
! let fname = Tex_GetMainFileName(':p')
else
let fname = expand('%:p')
--- 83,87 ----
" Find out which file we need to scan.
if Tex_GetMainFileName() != ''
! let fname = Tex_GetMainFileName(':p:r')
else
let fname = expand('%:p')
***************
*** 147,154 ****
endif
- let v:errmsg = ''
- " write down the name of this package in the fake buffer.
- call Tex_Debug('silent! find '.packname.'.sty', 'pack')
split
exec 'silent! find '.packname.'.sty'
call Tex_Debug('present file = '.bufname('%'), 'pack')
--- 147,154 ----
endif
split
+
+ call Tex_Debug('silent! find '.packname.'.sty', 'pack')
+ let thisbufnum = bufnr('%')
exec 'silent! find '.packname.'.sty'
call Tex_Debug('present file = '.bufname('%'), 'pack')
***************
*** 156,160 ****
" If this file was not found, assume that it means its not a
" custom package and mark it "scanned".
! if v:errmsg =~ '^E345'
let scannedPackages = scannedPackages.','.packname
q
--- 156,162 ----
" If this file was not found, assume that it means its not a
" custom package and mark it "scanned".
! " A package is not found if we stay in the same buffer as before and
! " its not the one where we want to go.
! if bufnr('%') == thisbufnum && bufnr('%') != bufnr(packname.'.sty')
let scannedPackages = scannedPackages.','.packname
q
***************
*** 162,166 ****
call Tex_Debug(packname.' not found anywhere', 'pack')
let i = i + 1
! let packname = Tex_Strntok(g:Tex_package_detected)
continue
endif
--- 164,168 ----
call Tex_Debug(packname.' not found anywhere', 'pack')
let i = i + 1
! let packname = Tex_Strntok(g:Tex_package_detected, ',', i)
continue
endif
***************
*** 297,301 ****
" /somepattern
" issued in a closed fold _always_ goes to the first match.
! normal! ggVGzO
" The wrap trick enables us to match \usepackage on the first line as
--- 299,305 ----
" /somepattern
" issued in a closed fold _always_ goes to the first match.
! let erm = v:errmsg
! silent! normal! ggVGzO
! let v:errmsg = erm
" The wrap trick enables us to match \usepackage on the first line as
***************
*** 365,369 ****
" 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
--- 369,375 ----
" functionality to remember the fold-state before opening up all the folds
" and then re-creating them. Use mkview.vim.
! let erm = v:errmsg
! silent! normal! ggVGzC
! let v:errmsg = erm
" Because creating list of detected packages gives string
|