kaarmu / typst.vim

Vim plugin for Typst
MIT License
281 stars 24 forks source link

Math mode text colour is applied after escaped dollar sign #80

Closed maxigaz closed 7 months ago

maxigaz commented 8 months ago

In Neovim v0.9.5 and typst.vim, typing an escaped dollar sign \$ is interpreted as if text after the dollar sign belonged to math mode.

For example, let's start with the following piece of text, typed into an empty buffer:

90 per month

Some text

This all looks good for me:

typst-dollar-syntax-1

If I wrap 90 with a $ on both sides, it still looks fine:

typst-dollar-syntax-2

However, if I change the first line to \$90 per month, everything after that part will be coloured blue:

typst-dollar-syntax-3

As a matter of fact, if I have an unescaped opening $, intentionally leaving the closing $, it looks the same. (Except for the $ highlighted in red. That's an error about the missing closing $ reported by LSP.)

typst-dollar-syntax-4

kaarmu commented 7 months ago

Thank you for reporting this issue!

maxigaz commented 7 months ago

Thank you for the fix!