Vimtex: Does bibliography completion cache some results?

Created on 24 Sep 2019  路  2Comments  路  Source: lervag/vimtex

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

  • Open file with nvim -u mimimal.vimrc minimal.tex
  • Insert mode at the end of line 4 in minimal.tex, and call completion with <C-X><C-O>, which works as expected providing suggestions for bar_2017 and none_2017
  • Insert a new line and type \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
bug

All 2 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itsShnik picture itsShnik  路  5Comments

vsbuffalo picture vsbuffalo  路  3Comments

sharethewisdom picture sharethewisdom  路  3Comments

LuxGiammi picture LuxGiammi  路  3Comments

thomasahle picture thomasahle  路  4Comments