Hi lervag, I have encountered this issue with completion of citations. Generally, I have noted that it affects very large bib files, but it seems I was able to create a small reproducible example.
Issue
Completion for bib file does not work as expected. It seems that the results are somehow cached.
minimal.vim
call plug#begin('~/.local/share/nvim/plugged')
Plug 'lervag/vimtex'
call plug#end()
" Vimtex options go here
let g:vimtex_view_method = 'zathura'
let g:vimtex_compiler_progname = 'nvr'
minimal.tex
\documentclass{article}
\begin{document}
This is an attempt to reproduce the issue
\cite{bar
\bibliography{bib2.bib}
\bibliographystyle{plainnat}
\end{document}
bib2.bib
@article{foo_2017,
title = {Foo},
journal = {Journal},
author = {fooauthor},
year = {2017},
}
@article{bar_2017,
title = {Bar},
journal = {Journal},
author = {barauthor},
year = {2017},
}
@article{none_2017,
title = {Another title containing Bar},
journal = {Journal},
author = {barauthor},
year = {2019},
}
Commands/Input
nvim -u mimimal.vimrc minimal.texminimal.tex, and call completion with <C-X><C-O>, which works as expected providing suggestions for bar_2017 and none_2017\cite{f, then call <C-X><C-O>Observed Behaviour
The pop-up shows again suggestions for bar_2017 and none_2017.
Expected Behaviour
Complete with foo_2017
Output from VimtexInfo
System info
OS: Ubuntu 16.04.6 LTS
Vim version: NVIM v0.4.0
Has clientserver: true
Servername: /tmp/nvimrhApuE/0
vimtex project: main
base: main.tex
root: /home/meme/GIT/issue2
tex: /home/meme/GIT/issue2/main.tex
out: /home/meme/GIT/issue2/main.pdf
log: /home/meme/GIT/issue2/main.log
aux: /home/meme/GIT/issue2/main.aux
fls: /home/meme/GIT/issue2/main.fls
compiler: latexmk
backend: nvim
output: /tmp/nvimrhApuE/1
configuration:
continuous: 1
callback: 1
latexmk options:
-verbose
-file-line-error
-synctex=1
-interaction=nonstopmode
latexmk engine: -pdf
viewer: Zathura
xwin id: 0
qf: LaTeX logfile
config:
packages:
default: 1
default: 1
document class: article
Thanks, good catch! I've fixed it now, I think. This was actually a bad bug, I'm surprised noone noticed before!
Thanks a lot for the rapid fix! Glad I could help