vim-pandoc / vim-rmarkdown

Rmarkdown support for vim
98 stars 26 forks source link

Not an editor command: PandocHighlight r | python #27

Open wenjie1991 opened 4 years ago

wenjie1991 commented 4 years ago

The Nvim reports the following error while open the RMarkdown file: image After removing the corresponding lines (here and here), the errors disappeared. And the highlights seem normal.

alerque commented 4 years ago

@wenjie1991 I think you have an issue with this plugin's dependencies and/or the order in which you load them. This plugin is dependent on both vim-pandoc and vim-pandoc-syntax. The syntax rules included here and meant to be an extensions of the ones in vim-pandoc-syntax. The PandocHighlight command that is causing you trouble here is defined over there.

Please let us know if that fixes it for you.

wenjie1991 commented 4 years ago

Hi @alerque, thanks for replying. Yes, there are no errors when I enable the vim-pandoc-syntax plugin. So my original question was solved.

However, it seems the enabling of the vim-pandoc-syntax plugin will disable the python block highlighting. image And the highlighting function is normal after disabling the vim-pandoc-syntax plugin. image It looks like that the vim-pandoc-syntax plugin has a higher priority. Finally, I tried to trigger the highlighting of python block by setting:

let g:pandoc#syntax#codeblocks#embeds#langs = ["python", "r"]
alerque commented 4 years ago

Hmm, that legitimately looks like a bug. Running this plugin should enable those highlights by default. It kind of looks like the two implementations were done separately and have diverged. We should fix that, so I'm going to re-open this issue if you don't mind until there is a clean satisfactory fix.