Add support for bibfiles for old citecompletion

Does anybody still use this old completion?
This commit is contained in:
Gerd Wachsmuth
2017-02-03 20:23:56 +01:00
parent d9d05f66f2
commit a23e86508c
+6 -4
View File
@@ -380,11 +380,13 @@ function! s:Tex_CompleteRefCiteCustom(type)
let prefixlength=strlen(s:prefix)
if a:type =~ 'cite'
if getline('.') =~ '\\bibitem\s*{'
let bibkey = matchstr(getline('.'), '\\bibitem\s*{\zs.\{-}\ze}')
else
let bibkey = matchstr(getline('.'), '\\bibitem\s*\[.\{-}\]\s*{\zs.\{-}\ze}')
" Look for a '\bibitem'
let bibkey = matchstr(getline('.'), '\\bibitem\s*\%(\[.\{-}\]\)\?\s*{\zs.\{-}\ze}')
if bibkey == ""
" Look for a '@article{bibkey,'
let bibkey = matchstr(getline('.'), '@\w*{\zs\w*\ze,')
endif
let completeword = bibkey
elseif a:type =~ 'ref'