Revision: 1050
http://vim-latex.svn.sourceforge.net/vim-latex/?rev=1050&view=rev
Author: tmaas
Date: 2009-04-29 13:29:56 +0000 (Wed, 29 Apr 2009)
Log Message:
-----------
Make \cite completion work for \bibitem with labels and spaces: \bibitem [A] {a}
Patch by Thomas Ibbotson and Mat?\195?\173as Gra?\195?\177a
Modified Paths:
--------------
trunk/vimfiles/ftplugin/latex-suite/texviewer.vim
Modified: trunk/vimfiles/ftplugin/latex-suite/texviewer.vim
===================================================================
--- trunk/vimfiles/ftplugin/latex-suite/texviewer.vim 2009-04-26 17:56:24 UTC (rev 1049)
+++ trunk/vimfiles/ftplugin/latex-suite/texviewer.vim 2009-04-29 13:29:56 UTC (rev 1050)
@@ -380,10 +380,10 @@
function! s:Tex_CompleteRefCiteCustom(type)
if a:type =~ 'cite'
- if getline('.') =~ '\\bibitem{'
- let bibkey = matchstr(getline('.'), '\\bibitem{\zs.\{-}\ze}')
+ if getline('.') =~ '\\bibitem\s*{'
+ let bibkey = matchstr(getline('.'), '\\bibitem\s*{\zs.\{-}\ze}')
else
- let bibkey = matchstr(getline('.'), '{\zs.\{-}\ze\(,\|$\)')
+ let bibkey = matchstr(getline('.'), '\\bibitem\s*\[.\{-}\]\s*{\zs.\{-}\ze}')
endif
let completeword = strpart(bibkey, strlen(s:prefix))
@@ -616,7 +616,7 @@
split
lcd %:p:h
call Tex_Debug("silent! grepadd! ".Tex_EscapeForGrep('\\bibitem{'.a:prefix)." %", 'view')
- call Tex_Grepadd('\\bibitem{'.a:prefix, "%")
+ call Tex_Grepadd('\\bibitem\s*[\[|{]'.a:prefix, "%")
q
return 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|