-
Notifications
You must be signed in to change notification settings - Fork 407
Better handling of \\) in nested environments #2311
Copy link
Copy link
Closed
Labels
Description
The current behaviour of \\) is to group the \ with \). Although this is not technically correct, it is actually the desirable behaviour since it prevents the rest of the document from being rehighlighted/reconcealed when entering commands in math mode.
However consider the following:
\(\begin{bmatrix}
a\\b\\)
\end{bmatrix}\)Here \\) is intended to insert a new line. However this instead breaks syntax highlighting.
I am proposing the following behaviour:
- If
\\)appears in the top-level of an inline math expression, highlight it as\and\), as using\\in inline math is very rare, and the user's cursor is likely between the two\'s. - If
\\)appears in an environment nested inside inline math, highlight it as\\and).
(Note: I don't know how vim's highlighter does tokenizing/parsing, so if this is not possible please close the issue.)
Reactions are currently unavailable