SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 365 forks source link

Syntax highlighting breaks for single $ sign in \mintinline #1396

Closed stephenlevitt closed 5 years ago

stephenlevitt commented 5 years ago

\mintinline{js}{$} breaks syntax highlighting as the highlighter looks for a matching dollar sign.

On the other hand, \verb!$! works fine.

r-stein commented 5 years ago

Note: The syntax is shipped from Sublime Text not from LaTeXTools, therefore the issue should be located at https://github.com/sublimehq/Packages . However we can first try to solve it here, since I am also a contributor to the LaTeX syntax.

Which Sublime Text version are you using and are you using the default LaTeX syntax? \mintinline{js}{$} does not break the syntax highlighting in my installation.

stephenlevitt commented 5 years ago

Thanks for looking into the issue!

I am using Sublime Text Version 3.1.1 Build 3176 and LaTeXTools v3.15.1 on Windows 10. I assume I am using the default syntax. Is that defined in: LaTeX.sublime-syntax ?

I have attached a screenshot to illustrate the problem.

syntax-highlighting-broken

stephenlevitt commented 5 years ago

BTW, this issue is also present in my setup when using the minted environment. For example \begin{minted}{bash} $ \end{minted} breaks the highlighting

r-stein commented 5 years ago

I think you use the wrong or an outdated LaTeX syntax. Have you edited a while ago or installed an other packages with LaTeX Syntax?

  1. Open the ST console ctrl+` and then execute view.settings().get('syntax'). This should output 'Packages/LaTeX/LaTeX.sublime-syntax'
  2. If it output the correct file you may select Preferences > Browse Packages and check if there is a LaTeX folder with a LaTeX.sublime-syntax file inside. If so move folder away and restart sublime text. You can also use OverrideAudit instead of manually checking it.
stephenlevitt commented 5 years ago

That worked! Thanks so much for your time.