Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Citation highlighting disappears after buffer switch #2165

Closed
bongbang opened this issue Sep 11, 2021 · 3 comments
Closed

Citation highlighting disappears after buffer switch #2165

bongbang opened this issue Sep 11, 2021 · 3 comments
Labels

Comments

@bongbang
Copy link

bongbang commented Sep 11, 2021

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
@bongbang bongbang added the bug label Sep 11, 2021
@lervag
Copy link
Owner

lervag commented Sep 11, 2021

Thanks! Should be fixed now!

Btw, you really should use set hidden in your config. In neovim, this is already the default, and I don't really see any reason not to set this.

@lervag lervag closed this as completed Sep 11, 2021
@bongbang
Copy link
Author

bongbang commented Sep 14, 2021 via email

@lervag
Copy link
Owner

lervag commented Sep 14, 2021

No problem, glad to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants