Fixed #531: Error in cite compl. of thebibliography
This commit is contained in:
parent
8d75f01cdd
commit
7244f48322
@ -198,16 +198,19 @@ function! s:bib.search(regexp) dict " {{{2
|
|||||||
" Find data from 'thebibliography' environments
|
" Find data from 'thebibliography' environments
|
||||||
let lines = readfile(b:vimtex.tex)
|
let lines = readfile(b:vimtex.tex)
|
||||||
if match(lines, '\C\\begin{thebibliography}') >= 0
|
if match(lines, '\C\\begin{thebibliography}') >= 0
|
||||||
for line in filter(filter(lines, 'v:val =~# ''\C\\bibitem'''),
|
for line in filter(filter(lines,
|
||||||
|
\ 'v:val =~# ''\C\\bibitem'''),
|
||||||
\ 'v:val =~ a:regexp')
|
\ 'v:val =~ a:regexp')
|
||||||
let match = matchlist(line, '\\bibitem{\([^}]*\)')[1]
|
let matches = matchlist(line, '\\bibitem\(\[[^]]\]\)\?{\([^}]*\)')
|
||||||
call add(res, {
|
if len(matches) > 1
|
||||||
\ 'key': match,
|
call add(res, {
|
||||||
\ 'type': '',
|
\ 'key': matches[2],
|
||||||
\ 'author': '',
|
\ 'type': '',
|
||||||
\ 'year': '',
|
\ 'author': '',
|
||||||
\ 'title': match,
|
\ 'year': '',
|
||||||
\ })
|
\ 'title': matches[2],
|
||||||
|
\ })
|
||||||
|
endif
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user