tpope / vim-markdown

Vim Markdown runtime files
1.22k stars 191 forks source link

Support vim9script version of defining g:markdown_fenced_languages #192

Closed craigmac closed 2 years ago

craigmac commented 2 years ago

When trying out vim9script and I set:

g:markdown_fenced_languages = ['cpp', 'jsx = javascriptreact', 'js = javascript', 'json', 'cmake', 'bash = sh' ]

in my vimrc (note spaces around the '=' is required in vim9script or it throws errors), I then get the following error when opening any markdown file:

Error detected while processing BufRead Autocommands for "*.markdown"..FileType Autocommands for "*"..Syntax Autocommands for "*"..function <SNR>7_SynSet[25]..script /Users/cmaceach/dotfiles/vim/.vim/pack/git/start/vim-markdown/syntax/markdown.vim:
line   36:
E484: Can't open file javascriptreact syntax/ javascriptreact.vim
line  134:
E399: Not enough arguments: syntax region markdownHighlight_ javascriptreact matchgroup=markdownCodeDelimiter start="^\s*\z(`\{3,\}\)\s*\%({.\{-}\.\)\=jsx }\=\S\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight_ javascriptreact concealends

I believe I might be this line, which is not expecting 'foo = bar', but instead expects 'foo=bar':

https://github.com/tpope/vim-markdown/blob/b78bbce3371a2eb56c89f618cd4ab2baadc9ee61/syntax/markdown.vim#L36

craigmac commented 2 years ago

My mistake, 'foo = bar' is not required inside a vim9script string, I just wrote it that way because the surrounded spaces is required in a few other cases in vim9script.