Closed jakewvincent closed 4 years ago
After recently updating vimtex, citation completion no longer works.
Thanks for the detailed report. I've tried to reproduce, but I'm sorry to say I can not. Completion works as expected for me.
minimal.vim
You can simplify the options: No need for the autocommand and no need to specify default settings. The following should suffice:
let g:tex_flavor = 'latex'
let g:vimtex_compiler_latexmk_engines = {
\ 'dvipspdf' : '-dvi -ps -pdfps',
\ 'xelatex' : '-xelatex -pdfxe',
\}
Perhaps the problem is related to the cache? Can you try to clear it? There is currently no command, but doing rm ~/.cache/vimtex/*.json
should do it (the only drawback is that some things may have a short delay until the cache is reproduced).
You can simplify the options: No need for the autocommand and no need to specify default settings. The following should suffice:
Thank you!
Perhaps the problem is related to the cache? Can you try to clear it? There is currently no command, but doing
rm ~/.cache/vimtex/*.json
should do it (the only drawback is that some things may have a short delay until the cache is reproduced).
Just cleared the cache---no luck, unfortunately. I forgot to mention this is happening for me on two machines (which share the same init.vim file). Any idea what else I might try?
Could you try bisecting to locate which commit breaks things for you? I.e.:
Open a terminal and go to ~/.local/share/nvim/data/plugged/vimtex
.
First do git pull
to get the latest version.
In a different terminal, go to the test and check if you can reproduce the error. If not, then I guess it is gone and we stop. If you can reproduce, proceed.
Now do git bisect start
, then git bisect bad
. Then git checkout 8ab0b0e^
(this should be the commit you were on before the :PlugUpdate
). Check that the problem is now gone, and if so, do git bisect good
. With that, Git should be ready to start the bisect process and will automatically go to the next commit. For each commit, test if the problem is reproducible, and mark the commit with git bisect bad
or git bisect good
depending on the result.
Just to say I encountered this issue today but doing git pull
in my vimtex directory appears to have fixed it. Unfortunately I don't have time atm to look any further into the cause or which commits completion was failing under, but thought this data point might be useful nonetheless.
- Open a terminal and go to
~/.local/share/nvim/data/plugged/vimtex
.- First do
git pull
to get the latest version.- In a different terminal, go to the test and check if you can reproduce the error. If not, then I guess it is gone and we stop. If you can reproduce, proceed.
This didn't fix it; going to step 4.
- Now do
git bisect start
, thengit bisect bad
. Thengit checkout 8ab0b0e^
(this should be the commit you were on before the:PlugUpdate
). Check that the problem is now gone, and if so, dogit bisect good
. With that, Git should be ready to start the bisect process and will automatically go to the next commit. For each commit, test if the problem is reproducible, and mark the commit withgit bisect bad
orgit bisect good
depending on the result.
After git checkout 8ab0b0e^
the problem was gone. Here's the output at the end of the bisect process:
b7fbff179005845b03b713b7a46fa28784afdf42 is the first bad commit
commit b7fbff179005845b03b713b7a46fa28784afdf42
Author: Karl Yngve Lervåg <karl.yngve+git@gmail.com>
Date: Sun Jul 12 23:25:40 2020 +0200
feat: use blg to parse included bib files when possible
refer: #1745
autoload/vimtex/complete.vim | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
This is quite as expected. When you say things don't work, can you check if there's a .blg
file in your project? Does it work if you remove that file?
Does it work if you remove that file?
Yes, after finishing the bisection search and ensuring citation completion isn't working, once I remove the .blg
file, completion works again.
Ok, now we're getting somewhere!
The problem seems to be that, on your end, the .blg
method for locating the included bibliography files does not work. To get further, can you please give me:
.blg
file in the case where things don't work.\bibliography{...}
or \addbibresource
lines).tree
or ls -lR
).I think I should be able to figure things out from those things.
- The contents of the
.blg
file in the case where things don't work.
[0] Config.pm:304> INFO - This is Biber 2.12
[0] Config.pm:307> INFO - Logfile is 'jwv_syntax_ms.blg'
[18] biber:315> INFO - === Tue Jul 21, 2020, 15:20:40
[32] Biber.pm:371> INFO - Reading 'jwv_syntax_ms.bcf'
[74] Biber.pm:889> INFO - Found 1 citekeys in bib section 0
[84] Biber.pm:4093> INFO - Processing section 0
[93] Biber.pm:4254> INFO - Looking for bibtex format file '/home/jake/Documents/library.bib' for section 0
[129] bibtex.pm:1523> INFO - LaTeX decoding ...
[992] bibtex.pm:1340> INFO - Found BibTeX data source '/home/jake/Documents/library.bib'
[1039] UCollate.pm:68> INFO - Overriding locale 'en-US' defaults 'normalization = NFD' with 'normalization = prenormalized'
[1039] UCollate.pm:68> INFO - Overriding locale 'en-US' defaults 'variable = shifted' with 'variable = non-ignorable'
[1039] Biber.pm:3921> INFO - Sorting list 'nyt/global//global/global' of type 'entry' with template 'nyt' and locale 'en-US'
[1039] Biber.pm:3927> INFO - No sort tailoring available for locale 'en-US'
[1040] bbl.pm:636> INFO - Writing 'jwv_syntax_ms.bbl' with encoding 'UTF-8'
[1041] bbl.pm:739> INFO - Output to jwv_syntax_ms.bbl
- The contents of the preamble in your LaTeX file + the lines that add the bibliographies in your TeX files (e.g.
\bibliography{...}
or\addbibresource
lines).
Here's the \addbibresource
line from the preamble, first:
%-- Bibliography resources --%
\addbibresource{/home/jake/Documents/library.bib}
%\addbibresource{C:/Users/jakew/Documents/library.bib} % uncomment if on Windows
And the whole preamble:
%! TEX program = dvipspdf
\documentclass[11pt]{article}
%----------------%
%-- Font stuff --%
%----------------%
\usepackage{tinos}
\usepackage{anyfontsize}
%-- Symbols --%
\usepackage{amssymb}
\newcommand{\cmark}{\ding{51}}
\newcommand{\xmark}{\ding{55}}
\usepackage[nointegrals]{wasysym}
\usepackage{marvosym}
\usepackage{textcomp}
\usepackage{upgreek}
\usepackage{pifont}% http://ctan.org/pkg/pifont
%-- Font decoration --%
\usepackage[normalem]{ulem}
\usepackage[outline]{contour} % for putting a glow effect behind text (for head noun boxes)
\newcommand{\myuline}[1]{\uline{\contour{white}{#1}}}
%---------------------%
%-- Page formatting --%
%---------------------%
%-- Margins --%
\usepackage[margin=1in]{geometry}
%-- Columns --%
\usepackage{multicol}
%----------------%
%-- References --%
%----------------%
\usepackage[colorlinks]{hyperref}
\usepackage[backend=biber,
bibstyle=authoryear,
citestyle=authoryear-comp,
maxcitenames=2,
minnames=1,
uniquelist=false,
bibencoding=utf8]{biblatex} % Note that uniquelist=false may lead to citations being ambiguous, esp. if the citation year is the same.
%-- Bibliography resources --%
\addbibresource{/home/jake/Documents/library.bib}
%\addbibresource{C:/Users/jakew/Documents/library.bib} % uncomment if on Windows
- The "structure" of your LaTeX projects (e.g. output of
tree
orls -lR
).
Output of tree
:
.
├── alternate
│ └── syntaxtemplate.pdf
├── jwv_syntax_ms.aux
├── jwv_syntax_ms.bbl
├── jwv_syntax_ms.bcf
├── jwv_syntax_ms.blg
├── jwv_syntax_ms.dvi
├── jwv_syntax_ms.fdb_latexmk
├── jwv_syntax_ms.fls
├── jwv_syntax_ms.log
├── jwv_syntax_ms.out
├── jwv_syntax_ms.pdf
├── jwv_syntax_ms.ps
├── jwv_syntax_ms.run.xml
├── jwv_syntax_ms.synctex.gz
├── jwv_syntax_ms.tex
└── outline.xopp
2 directories, 28 files
Ok, I see. In your case, for some reason, you don't get the lines
[135] Utils.pm:75> INFO - Globbing data source '/home/lervag/.vim/bundle/vimtex/test/issues/1751/minimal.bib'
[136] Utils.pm:91> INFO - Globbed data source '/home/lervag/.vim/bundle/vimtex/test/issues/1751/minimal.bib' to /home/lervag/.vim/bundle/vimtex/test/issues/1751/minimal.bib
This explains the problem. I might have been to quick, so I'll add an update that parses things more robust.
Ok, I think I've fixed this now, please test.
Works beautifully. Thanks!! :)
Great, happy to hear it :)
Issue
After recently updating vimtex, citation completion no longer works. Below, I'm providing the output of :PlugDiff after running :PlugUpdate. When I revert these updates, citation completion works fine.
:PlugDiff
minimal.vim
minimal.tex
/home/lervag/minimal.bib
Commands/Input
Type
\cite{
and in insert mode, do CTRL-X CTRL-O.Observed Behaviour
After updating vimtex Nothing happens. In the statusline, I see
-- Omni completion (^O^N^P) Pattern not found
After reverting vimtex update The citation is completed with
knuth1981
.Expected Behaviour
Citation is completed with
knuth1981
both before and after update of vimtex plugin.Output from VimtexInfo