Skip to content

Citation highlighting disappears after buffer switch #2165

@tomvam

Description

@tomvam

Description

Citation highlighting disappears after a switch to a different buffer. Recompilation is necessary to bring it back. This issue didn't exist before the fix for #2152.

The only line is my .latexmkrc is $pdf_mode = 4;.

Steps to reproduce

  1. gvim -u minimal.vim minimal.tex
  2. Note the proper highlighting for \autocites
  3. e dummy.tex to switch buffer
  4. ctrl-6 switch back
  5. Note that the highlighting is gone.
  6. <local-leader>ll to compile.
  7. Note that the highlighting is back.
set nocompatible
let &runtimepath  = '~/vimfiles/bundle/vimtex,' . &runtimepath " on Windows
let &runtimepath .= ',~/vimfiles/bundle/vimtex/after' " on Windows
set encoding=utf8
filetype plugin indent on
syntax enable

let g:vimtex_compiler_latexmk = {
      \ 'continuous' : 0,
      \}
\documentclass{article}
\usepackage[style=verbose-ibid]{biblatex}
\addbibresource{highlight.bib}

\begin{filecontents}{highlight.bib}
@book{piccato,
  author       = {Piccato, Pablo},
  title        = {City of Suspects},
  date         = 2001,
  publisher    = {Duke University Press},
}
@book{vangennep,
  author       = {van Gennep, Arnold},
  title        = {Les rites de passage},
  date         = 1909,
  publisher    = {Nourry},
}
\end{filecontents}

\begin{document}

\begin{enumerate}
  \item Only the postnote (``10'') is highlighted.
    \autocite[10]{piccato}
  \item No highlight here.
    \autocites{piccato}{vangennep}
  \item Only the postnote is highlighted.
    \autocites[10]{piccato}{vangennep}
  \item Only the first postnote is highlighted.
    \autocites[10]{piccato}[20]{vangennep}
  \item No highlight here.
    \autocites{piccato}[20]{vangennep}
\end{enumerate}
\end{document}

Expected behavior

Syntax highlighting should not be affected by switching buffer.

Actual behavior

Citation highlighting disappears after buffer is switched.

Do you use a latexmkrc file?

Yes

VimtexInfo

System info
  OS: Microsoft Windows 10 Pro (10.0.19043 N/A Build 19043)
  Vim version: VIM 8.2 ()
  Has clientserver: true
  Servername: GVIM1

VimTeX project: highlight
  base: highlight.tex
  root: C:\Users\Tom\Google Drive\Drug war
  tex: C:\Users\Tom\Google Drive\Drug war\highlight.tex
  main parser: current file verified
  document class: article
  packages: biblatex blx-case-expl3 etoolbox expl3 iftex ifthen infwarerr keyval kvoptions kvsetkeys logreq ltxcmds pdftexcmds url xparse
  compiler: latexmk
    engine: -lualatex
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 0
    executable: latexmk
    process: 
      jobid: process 33932 dead
      output: C:\Users\Tom\AppData\Local\Temp\VIAA314.tmp
      cmd: set max_print_line=2000 & latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -lualatex "highlight.tex"
  viewer: General
  qf method: LaTeX logfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions