-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax error in tagged code block breaks highlighting outside the code block. #283
Comments
It seems like this is problematic even for github's markdown parser ;) Some embedded syntax files can create this kind of conflict, there isn't really anything that can be done as a general fix really (the solution would be to fix the javascript syntax so that it behaves differently when it is embedded, but it's not obvious how do to it...) :( |
Does vim really not let us limit the scope of any applicable embedded rules based on our rules for where the scope ends? |
Not really. Some cases are just pathological. I remember a case where ruby or perl embeds would cause this sort of thing. The problem is that in some cases the match doesn't terminate, and the highlighting doesn't yield (I think the underlying issue is the same that we have when a rule fails and it ends breaking the rest of the file...). |
@nybblr Apparently the answer is "this is a can of worms". See also #236. I poked around a little and it looks like Neovim issue 9876 is one thing to keep an eye on. Also we've talked before about using Pandoc itself to determine the block context, but that would require implementing the change noted in Pandoc issue 4565. Neither of these things help you with your project right now, but we'll be keeping an eye on them for the long term. |
Ooo, I am intrigued, thanks for poking around @alerque. |
Hey folks, I'm using vim-pandoc for editing a coding book. Most of the book is incomplete JavaScript code samples. It seems that when there is a syntax error in a marked code snippet — such as a missing parenthesis or curly — it breaks all following syntax highlighting. Here's an example:
Since the book is primarily made of incomplete snippets, it's tricky to workaround and makes it difficult to spellcheck or spot other errors.
Thoughts? Is this a can of worms in Vim's syntax highlighting engine?
The text was updated successfully, but these errors were encountered: