kaarmu / typst.vim

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

Error 'Pattern uses more memory than 'maxmempattern' and text highlighting disappears when typing < character #102

Closed jfab20 closed 1 week ago

jfab20 commented 2 months ago

When I'm typing a reference <hello> I get the error Pattern uses more memory than 'maxmempattern' and the text highlighting disappears in all the file. I have to manually type set ft=typst to get back text highlighting. I have noticed that the error also appears if I have <hello in my file anywhere, note the lack of the closing >. In that case no matter how many times I set the filetype to typst, the highlighting doesn't come back. Only when I close with > I can type set ft=typst.

This is a problem because I cannot type labels by hand, because when I type the opening <, typst crashes (other features of typst still work, it's just the highlighting).

I am in neovim, installed the latest version of typst.vim with vim-plug. This error does not appear when I disable typst.vim of course.

kaarmu commented 2 weeks ago

Hmm, that is weird. Is your file particularly long or have very many references? I cannot recreate the error in an empty file with neovim v0.9.5 or vim v9.1

jfab20 commented 1 week ago

Hmm, that is weird. Is your file particularly long or have very many references? I cannot recreate the error in an empty file with neovim v0.9.5 or vim v9.1

I get this error with a blank file, no references. I am in nvim 0.10.1. I will try to remove my plugins one by one and try to retrace the error to one of those plugins, but I don't have many so that is why assumed it was a typst.vim error. I also don't get this error anywhere else.

Update: Removing all my plugins doesn't seem to help.

jfab20 commented 1 week ago

Ok, after changing my configuration in my init.vim, I think I found that the issue is only present when I have set re=1 in my configuration. I don't remember why I put that there or what it does, but I just removed that and the issue goes away. Sorry for the inconvenience.