habamax / vim-asciidoctor

Asciidoctor plugin for Vim
MIT License
182 stars 16 forks source link

Plugin overriding colorscheme highlight groups #82

Closed usaoc closed 3 years ago

usaoc commented 3 years ago

Hi. It seems like that the syntax file includes an augroup which overrides colorscheme highlight groups even when they are set in the colorscheme. https://github.com/habamax/vim-asciidoctor/blob/f39d17a893c14aefcfed47f7ef3252e057f5c514/syntax/asciidoctor.vim#L286-L291 Preferably this should be done by hi def link, like what the markdown.vim file that ships with vim does. That way, users can define their own highlighting for asciidoctorItalic and asciidoctorBoldItalic. This is useful when users use a font without italics definition. Thanks.

habamax commented 3 years ago

Thx!

usaoc commented 3 years ago

Hi, the other hi commands should be changed to hi def as well, otherwise it would still override custom highlight group definitions everytime set ft=asciidoctor is executed. The augroup should be removed altogether, as the only thing it does is executing hi command when users change a colorscheme, which is not needed given hi def.

habamax commented 3 years ago

Well, autocommand was added to mitigate issue with vim (unable to properly clean highlights and restore default links) and colorscheme changes.

Basically, if you have stable vim, you would be able to reproduce it having **bold** text and changing colorscheme to elflord or any other default colorschemes.

Anyway, the issue in vim dev is fixed (not 100%, for our case you would still need to :syn on after colorscheme change to reapply default asciidoctorBold/Italic), so I will remove autocommand.

usaoc commented 3 years ago

Interesting, never realized that. But I still think the definitions should be done colorscheme-wise. Anyway, thanks :)

habamax commented 3 years ago

for reference: https://github.com/vim/vim/issues/4405