I have a parenthesis in my LaTeX document that is intentionally unmatched. This breaks syntax highlighting for all of the following text.
Is there some way to reset syntax highlighting after this point?
The %stopzone
trick that works for other LaTeX syntax breakages doesn't work here. Neither does inserting a matching paren in a comment.
Here's a small example that exhibits the problem:
\documentclass{article} \begin{document} \begin{itemize} \item \textit{properly} highlighted \end{itemize} ( \begin{itemize} \item \textit{improperly} highlighted \end{itemize} \end{document}
(
starts atexParen
syntax region: see section starting at" Try to flag {} and () mismatches:
in tex.vim. You could probably apply a fix similar to this one.%stopzone
to the end conditions of texParen, but that doesn't seem to work.tex.vim
,oneline
is added at the end of each of the twosyn region texParen ...
lines.oneline
? You can also change this locally by doing asyn clear texParen
in~/.vim/after/syntax/tex.vim
and then copying and modifying the corresponding lines from the stocktex.vim
. I tried this and it seems to work great for my use case, and it also seems to still support paren matching over multiple lines.