vim-pandoc / vim-criticmarkup

criticmarkup support for vim

Repository from Github https://github.comvim-pandoc/vim-criticmarkupRepository from Github https://github.comvim-pandoc/vim-criticmarkup

Possible conflict with `plasticboy/vim-markdown` plugin?

sheriferson opened this issue · comments

Hi,

I installed vim-criticmarkup but noticed that none of the criticmarkup highlighting has changed, and while going through my vimrc file to find possible causes, I decided to uninstall the plasticboy/vim-markdown plugin, and the criticmarkup highlights worked great after that.

I am assuming the vim-markdown plugin was overriding the highlighting settings that vim-criticmarkup plugin was setting, or that there was a conflict of some kind.

Do you know if there's a way to make the two work together?

I am also uncertain as to whether only I have this problem with the two plugins or if other people would too. The vim-markdown plugin is pretty popular so I was surprised to not see an previous issue about this here.

I'm happy to provide more information to help debug or find a cause.

Thanks.

Maybe there's a conflict in the initialization of the plugin. Can you try opening a markdown file using plasticboy/vim-markdown and executing the following manually?

call criticmarkup#InjectHighlighting()

:call criticmarkup#InjectHighlighting() made no visible change to the highlighting as far as I can tell.

Does it when you don't use plasticboy/vim-markdown? There shouldn't be any overlap, the highlight groups are grouped under the critic... namespace...

What is the output of hi criticAdd after you execute ...#InjectHighlighting()?

Without using plasticboy/vim-markdown the criticmarkup highlighting works as expected.

With plasticboy/vim-markdown, this is the output for
:hi criticAdd

criticAdd      xxx ctermfg=16 ctermbg=46 guifg=#101010 guibg=#00ff00

with the xxx highlighted in green. But {++ added ++} in the text is not highlighted.


I just noticed that highlighting works fine if it's for the first line in a file, but stops working after that for some reason:

screen shot 2017-04-12 at 1 25 47 pm

I'm starting to think it's something uniquely broken/strange with my setup and vimrc.

edit (+ the interaction with plasticboy/vim-markdown, because everything works fine without that plugin. I'm also starting to look into using vim-pandoc and vim-pandoc-syntax instead).

Well, I tested it over vim-pandoc-syntax (i'm the maintainer [not that I really maintain it that much these days though :/]), but this is still weird.

@plasticboy, any thoughts?

I would say go ahead and open an issue against my vim-markdown repo. I also don't really maintain much these days and don't know much about plugin conflicts, but someone over there might.

I stumbled on this issue several days ago and opened an issue with vim-markdown which appears to never have been done. However, since then I took another look and found it to be due to "missing" syntax groups in the containedin attribute of the critic* syntax regions.
I pushed a rather dirty fix to my fork by simply appending all the syntax groups which I deemed relevant. Some may be missing though.

A cleaner solution could involve updating the containedin attribute at a later point (e.g. in a user config file and only when the vim-markdown plugin is being used). However, I don't know whether this is possible. If you know of a clean way of doing so, I am eager to find out!

I think for now the best thing to do is probably include your "dirty" fix of all the possibly relevant syntax groups, or possibly if that is confusing to have a conditional to run one set of matches if using plasticboy's syntax and another if using vim-pandoc-syntax or whatever.

Can you go ahead and open a Draft PR with your fix @mrossinek?