Closed meyamay closed 4 years ago
I've tested with a minimal example:
test.vim
file:
set nocompatible
" You should of course make sure the following paths are correct on your
" system. That is, `~/.vim/bundle` should be replaced with whereever you put
" your plugins.
let &rtp = '~/.vim/bundle/wiki-ft.vim,' . &rtp
let &rtp = '~/.vim/bundle/wiki.vim,' . &rtp
let &rtp .= ',~/.vim/bundle/wiki.vim/after'
let &rtp .= ',~/.vim/bundle/wiki-ft.vim/after'
filetype plugin indent on
syntax enable
test.wiki
file:
```c
void main() {}
void main() {}
When I open with `nvim -u test.vim test.wiki`, it seems to work as expected.
You're right, my bad. The culprit is vim-polyglot. Seems like it doesn't play nice with the nested highlighting.
For anyone else who may stumble upon this issue, the following variable fixes said conflict:
let g:cpp_no_function_highlight = 1
Ah, great, and thanks for the hint.
In the above, each { will be highlighted red (the same highlight vim uses to convey a missing ending bracket). This works with actual function definitions too, i.e.
void main() {}
and with C++ code highlighting.This behavior is not present with only one code block:
It is also fine if multiple definitions are contained in exactly one code block.
I'm fairly sure the bug is confined to this highlighting plugin, as I am unable to reproduce the behavior using vimwiki's code block highlighting.