tpope / vim-markdown

Vim Markdown runtime files
1.23k stars 191 forks source link

Adding 'markdown' to g:markdown_fenced_languages results in lots of errors #217

Open scy opened 1 week ago

scy commented 1 week ago

I'm documenting a Markdown-based software, and thus I have fenced code blocks that start with ```markdown.

When I try to add 'markdown' to the list in g:markdown_fenced_languages, Vim (and Neovim) eats a lot of CPU for a second, then throws a lot of errors at me:

Error detected while processing /usr/share/nvim/runtime/syntax/markdown.vim:                                                             
line   29:                                                                                                                               
E847: Too many syntax includes                                                                                                           
line   31:                                                                                                                               
E121: Undefined variable: s:done_include                                                                                                 
line  105:                                                                                                                               
E121: Undefined variable: main_syntax                                                                                                    
line  165:                                                                                                                               
E121: Undefined variable: main_syntax                                                                                                    
line   31:                                                                                                                               
E121: Undefined variable: s:done_include                                                                                                 
line  105:                                                                                                                               
E121: Undefined variable: main_syntax
[…]

I assume I've hit some kind of infinite recursion.

Initializing s:done_include with {'markdown': 1} in syntax/markdown.vim (so that it won't try to include itself) gets rid of the errors, but also doesn't give me any syntax highlighting inside of ```markdown blocks.

I'm using the bundled version of this plugin, with the syntax file being tagged Last Change: 2020 Jan 14.