kaarmu / typst.vim

Vim plugin for Typst
MIT License
291 stars 25 forks source link

Incorrect highlight on `#show` #69

Closed jvoisin closed 10 months ago

jvoisin commented 11 months ago

The foolowing code results in the following highlight:

#show link: underline
#show link: set text(navy)
#show par: set block(spacing: 1.75em)

image

With neovim and the git version of typst.vim.

kaarmu commented 10 months ago

Thank you for reporting this!

Some notes on what is happening: This is caused by #show link: set text(navy) leaking the code mode from both the show part and the set part. This can be seen by adding two ;; after that line which will close both syn regions. Possible solution is to use keepend but it might cause other issues.