Syntax highlighting incorrectly reports an error when using \( and \) to open and close inline math expressions. The issue doesn't happen with $. The issue also exists on the default Neovim config (without VimTeX installed), but installing VimTeX makes the issue worse.
\documentclass{article}
\begin{document}
% Issues on this line.
Let \(F = \{f : S \to S \mid \textnormal{\(f\) is a cool function}\}\).
% No issues on this line.
Let \(F = \{f : S \to S \mid \textnormal{$f$ is a cool function}\}\).
\end{document}
Running nvim -u minimal.vim minimal.tex on the release build of Neovim 0.7.2, one can see issues on one of the lines where } and \) are highlighted red despite there being no error. Running nvim -u /dev/null minimal.tex on the same Neovim build, the same line contains wrong syntax highlighting for the last closing \) but not for }.
Expected behavior
No syntax highlighting indicating error: there is no error.
Actual behavior
Syntax highlighting indicating error.
Do you use a latexmkrc file?
No.
VimtexInfo
System info:
OS: Linux 5.18.6-arch1-1
Vim version: NVIM v0.7.2
Has clientserver: true
Servername: /tmp/nvimTznxGZ/0
VimTeX project: minimal
base: minimal.tex
root: /home/user/tmp/issue
tex: /home/user/tmp/issue/minimal.tex
main parser: current file verified
document class: article
compiler: latexmk
engine: -pdf
options:
-verbose
-file-line-error
-synctex=1
-interaction=nonstopmode
callback: 1
continuous: 1
executable: latexmk
viewer: General
qf method: LaTeX logfile
Description
Syntax highlighting incorrectly reports an error when using
\(
and\)
to open and close inline math expressions. The issue doesn't happen with$
. The issue also exists on the default Neovim config (without VimTeX installed), but installing VimTeX makes the issue worse.Steps to reproduce
minimal.vim
minimal.tex
Running
nvim -u minimal.vim minimal.tex
on the release build of Neovim 0.7.2, one can see issues on one of the lines where}
and\)
are highlighted red despite there being no error. Runningnvim -u /dev/null minimal.tex
on the same Neovim build, the same line contains wrong syntax highlighting for the last closing\)
but not for}
.Expected behavior
No syntax highlighting indicating error: there is no error.
Actual behavior
Syntax highlighting indicating error.
Do you use a latexmkrc file?
No.
VimtexInfo