kaarmu / typst.vim

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

Syntax Highlighting Errors #72

Closed ZaheenJ closed 9 months ago

ZaheenJ commented 9 months ago

While playing around with typst, I noticed a few inconsistencies compared to typst.app (and I think typst.app is correct). Here is typst.app: image Here is neovim with typst.vim: image

What immediately caught my attention was that quad was not highlighted differently in the math block which makes my brain think that it should be rendered as quad when of course it is just spacing. Then while taking the screenshots to make this issue, I noticed another issue (sorry for not creating separate issues but these seem relatively small). In the inline math expression, why are two of the three 'F's highlighted purple? Moreover, why would only the second and third be highlighted but not the first?

kaarmu commented 9 months ago

Hi, thank you for reporting the issue(s). Currently, I have to consider concealed math-blocks as an experimental feature due to the extensive problems discussed in #64. All I can say for now is yes, what you've reported are bugs. However, I will not look into this until #64 is fixed. (Although, if you get the same problems with concealment turned off then I can perhaps there is an easy fix.)

Small explanation about the 'F's is that the concealed F (i.e. the first one) uses another syntax rule and therefore gets another color.