area / language-latex

Syntax highlighting for LaTeX for Atom.
Other
78 stars 47 forks source link

escaped curly brackets not correctly highlighted #178

Open rammmiro opened 6 years ago

rammmiro commented 6 years ago

Steps to reproduce & Minimum working example

Crate a .tex file with the following line:

$a \in \{0,1\}^n$

Expected behaviour

Both escaped curly brackets should be highlighted.

Actual behaviour

example1

Additional information

They require additional spacing to be properly highlighted.

$a \in \{ 0,1\} ^n$

example2

I think this is not the expected behavior, particularly the space between the second bracket and the exponent seems weird to me.

Maybe I am confused and no highlighting should appear, but then it will be inconsistent, as a minus sing forces the highlighting:

$a \in \{-1,1\}^n$

example3

I hope I am not doing anything wrong and this issue to be helpful.

Aerijo commented 6 years ago

Anybody know what this is for?

https://github.com/area/language-latex/blob/2447b74978e2584e610e14d956c1c41cc1b8c7ab/grammars/tex.cson#L214-L220

It's the cause of the problem, but I don't even know why it's there.

https://regex101.com/r/FAsSJ5/1