[Vim-latex-cvs] vimfiles/ftplugin/tex texviewer.vim,1.26,1.27
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2003-06-22 17:57:20
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv5415 Modified Files: texviewer.vim Log Message: Bug: On windows gvim +cygwin, \cite completion does not work when the bib file is in a completeley different location. Cause: gvim calls grep as "grep -nH @.*{ /path/to/file" which does not work because grep thinks / corresponds to something like c:/cygwin, so it looks for the file in the wrong place. Fix: Always lcd to the current directory of the bib file being searched. This avoids any path issues. Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** texviewer.vim 20 Jun 2003 06:11:54 -0000 1.26 --- texviewer.vim 22 Jun 2003 17:57:16 -0000 1.27 *************** *** 504,517 **** split let thisbufnum = bufnr('%') exec 'silent! find '.Tex_Strntok(bibnames, ',', i).'.bib' if bufnr('%') != thisbufnum " use the appropriate syntax for the .bib file. exec 'silent! grepadd @.*{'.a:prefix.' %' else let thisbufnum = bufnr('%') - call Tex_Debug('silent! find '.Tex_Strntok(bibnames, ',', i).'.bbl from '.thisbufnum, 'bib') exec 'silent! find '.Tex_Strntok(bibnames, ',', i).'.bbl' call Tex_Debug('now in bufnum#'.bufnr('%'), 'bib') if bufnr('%') != thisbufnum exec 'silent! grepadd \\bibitem{'.a:prefix.' %' endif --- 504,521 ---- split let thisbufnum = bufnr('%') + call Tex_Debug('silent! find '.Tex_Strntok(bibnames, ',', i).'.bib', 'bib') exec 'silent! find '.Tex_Strntok(bibnames, ',', i).'.bib' if bufnr('%') != thisbufnum + call Tex_Debug('finding .bib file ['.bufname('%').']', 'bib') + lcd %:p:h " use the appropriate syntax for the .bib file. exec 'silent! grepadd @.*{'.a:prefix.' %' else let thisbufnum = bufnr('%') exec 'silent! find '.Tex_Strntok(bibnames, ',', i).'.bbl' call Tex_Debug('now in bufnum#'.bufnr('%'), 'bib') if bufnr('%') != thisbufnum + call Tex_Debug('finding .bbl file ['.bufname('.').']', 'bib') + lcd %:p:h exec 'silent! grepadd \\bibitem{'.a:prefix.' %' endif *************** *** 535,539 **** --- 539,547 ---- let foundCiteFile = 1 + + split + lcd %:p:h exec 'silent! grepadd \\bibitem{'.a:prefix.' %' + q return 1 *************** *** 549,559 **** let filename = matchstr(getline('.'), '\\\(input\|include\){\zs.\{-}\ze}') ! let v:errmsg = '' exec 'silent! find '.filename ! if v:errmsg == '' " DANGER! recursive call. let foundCiteFile = Tex_ScanFileForCite(a:prefix) - exec 'e #'.presBufNum endif if foundCiteFile --- 557,571 ---- let filename = matchstr(getline('.'), '\\\(input\|include\){\zs.\{-}\ze}') ! ! split ! let thisbufnum = bufnr('%') ! exec 'silent! find '.filename ! if bufnr('%') != thisbufnum " DANGER! recursive call. + call Tex_Debug('scanning recursively in ['.bufname('%').']', 'bib') let foundCiteFile = Tex_ScanFileForCite(a:prefix) endif + q if foundCiteFile |