Atom-LaTeX icon indicating copy to clipboard operation
Atom-LaTeX copied to clipboard

wrong colors

Open Dario-Rosa85 opened this issue 4 years ago • 5 comments

Could you help me in detecting why, after the following command

\newcommand{\be}{\begin{equation}}

the color palette becomes wrong, with the plain text becoming green? I attach a screenshot to show what I mean.

2020-06-26

Dario-Rosa85 avatar Jun 26 '20 11:06 Dario-Rosa85

The current syntax highlighting is accomplished using a set of regex rules

So when you define your \begin{equation} as it doesn't find a corresponding \end{equation} it highlights the rest of the document as an "equation" - hence green. If I were you, I wouldn't use such commands, and use the autocomplete functionality baked into the package to do this.

ashthespy avatar Jun 26 '20 11:06 ashthespy

Thank you! now it works

Dario-Rosa85 avatar Jun 26 '20 13:06 Dario-Rosa85

sorry. I have another example of weird highlighting: why after $\hat \gamma^i$ it remains in equation mode until the end of the period?

2020-06-30 (1)

Dario-Rosa85 avatar Jun 29 '20 17:06 Dario-Rosa85

That is unrelated; for this kind of grammar Atom limits the number of syntax tokens per line, as well as the parsed line length for performance reasons. These limits can be changed (see grammar-token-limit package), or you can split the content across multiple source lines.

Aerijo avatar Jun 30 '20 04:06 Aerijo

Thank you, @Aerijo. I did not know. I will split the lines.

Dario-Rosa85 avatar Jun 30 '20 05:06 Dario-Rosa85