numirias / semshi

🌈 Semantic Highlighting for Python in Neovim
1.03k stars 34 forks source link

Re-define highlights on ColorScheme autocommand #111

Open blueyed opened 3 years ago

blueyed commented 3 years ago

When using :colorscheme highlights are deleted, and need to be re-defined.

This wraps/moves this into semshi#init(), and triggers it on the ColorScheme autocommand.

It also wraps this and the conditional definition of the other autocommands in a new SemshiInit augroup, to not define the autocommands multiple times.

Fixes https://github.com/numirias/semshi/issues/70.

DanielArndt commented 3 years ago

Thanks @blueyed -- I tested this and it does fix my issue as reported in https://github.com/numirias/semshi/issues/90#issuecomment-929186760 (which would have been more appropriately reported as part of #70).

Stealthii commented 3 years ago

Can confirm this fix handles updates to syntax/colorscheme after load.

To test this PR's changes with VimPlug:

"Plug 'numirias/semshi', { 'do': ':UpdateRemotePlugins' }
Plug 'blueyed/semshi', { 'branch': 'handle-ColorScheme', 'do': ':UpdateRemotePlugins' }