Closed underscore-j closed 3 weeks ago
The opposite happens when an operator appears in a sub- or superscript, like r^+
.
The operator is not treated as part of the superscript, but as its next sibling.
Instead, the child of the superscript is an empty generic_command
.
Subscripts
_
and superscripts^
apply only to the next character (or text in curly braces).This parser, however, treats the entire next "word" as the sub- or superscript, which can lead to incorrect syntax highlighting or concealing.
(Granted, this probably doesn't occur very often, as spaces, operators and commands cause the word to end anyway. It came up for me when replacing spaces with
~
, which are treated as part of a word. Proper parsing could also help spot mistakes such as writing10^10
.)