Open PhilippImhof opened 4 years ago
The current syntax highlighting is accomplished using a set of regex rules and doesn't really parse the TeX.
It thus never finds the second argument of /end{tikzpicture}
to newenvironment
. It might be possible to add a rule for newenvironment
, but to be honest IIRC these grammars were just converted from the TextMate bundle, so I am not sure..
Yes, I saw that. It might however be worth making a change, e.g. reacting on \newenvironment
and thus not taking into account the \begin{tikzpicture}
, because it does not open an environment.
I have an important and quite complicated custom environment that includes an unmatched $
, which means the entire document is highlighted as though it is in math mode; the only reasonable way to edit it is to put this specific environment in a separate file and use \input
.
I understand why fixing this properly is so hard (TeX is Turing complete), but it would be sufficient to have the ability to mark (via comments) sections that we do not want the grammar to parse.
Consider the following minimal document:
This compiles without any errors. However, with the current grammar, every line after
\newenvironment
is in scopemeta.function.environment.latex.tikz
andmeta.group.braces.tex
which is not correct.