Closed Gordin closed 1 year ago
Confirmed the commit from @Gordin resolves it.
The context for me was writing a lua comment within the table of my nvim config plugins, like the OP pic.
Minimum to reproduce:
return {
--
}
A
or enter insert mode, and try to type something. The error may trigger before insert mode.I cannot reproduce the problem with the minimal example. I do remember having that issue at some point during development and having the same workaround for a while before I removed it. Do you have the comment
grammer installed? Which version or commit of the plugin are you using?
I want to replicate the issue before I include code to handle the case. My personal hunch is that it could be due to the comment
grammar; the comment
lanugage get injected into a lot of other languages, but it does not have a query defined.
Which version or commit of the plugin are you using?
commit 6bcb1472c321a15eef5a7a015b4fefa8758e6513 (HEAD -> master, origin/master, origin/HEAD)
NVIM v0.9.0-dev-1184+g0ecb4d725
Do you have the
comment
grammer installed?
Yes
My personal hunch is that it could be due to the
comment
grammar; thecomment
lanugage get injected into a lot of other languages, but it does not have a query defined.
Ah, that explains it! If I TSUninstall comment
and reopen the file, I can't reproduce it anymore.
OK, I can replicate the issue in Neovim 0.9 (pre-release), but not in 0.8.3. I'll take a deeper look into it. Thank you both for bringing it up.
The issue should now be fixed in 7711a873d1f16a9f3049715b63cdd71973108871, please verify. I opted for a different solution: if there is no query defined we do not set up any callback in the first place. This should be more performant because we run the check only once per parser, we do not create a callback, and we save a pointless function call.
If the issue is fixed this PR becomes obsolete.
Just to be sure there is no misunderstanding: you can now re-install the comment
grammar again. It should no longer cause any issues.
The issue should now be fixed in 7711a87, please verify.
Verified, 7711a87
fixes it and resolves this issue.
Thank you. I am now closing this PR as no longer relevant.
Can you please provide a sample Vue file as well? It needs to cover the various way of writing Vue, such as embedding different languages (e.g. embedding Javascript and embedding Typescript). If Vue does not allow to have two script
blocks then you can create separate test files.
See the files under test/highlight
for examples of what I mean.
Sorry, wrong PR.
Fixes this bug:
I'm not sure what causes this, but here it happens when I tried to add a comment, after I typed the space behind
--
.