dracula / vim

🧛🏻‍♂️ Dark theme for Vim
https://draculatheme.com/vim
MIT License
1.34k stars 455 forks source link

fix: support lazy-loading nvim-cmp #283

Closed stnley closed 2 years ago

stnley commented 2 years ago

Often users of nvim-cmp lazy-load this plugin. If users do that, then the highlight groups defined by this scheme don't get loaded with the current guard setup.

This proposes an autocmd which hooks into the documented CmpReady event, adding the highlights at that point.

Not sure how you feel about adding autocmds to the theme. I opted for a singular group ___dracula_cmp___ instead of a plugin-wide group (for example ___dracula___).

dsifford commented 2 years ago

@stnley Couldn't you just re-load after/plugin/dracula.vim with an autocmd on your end when you load the completion plugin?

stnley commented 2 years ago

@dsifford Yeah that method words - if that is preferred than shipping with them I can close this, and keep in that in mind in the future!

benknoble commented 2 years ago

Wouldn't this change mean that if nvim-cmp is not lazy loaded, and happens to run before after/plugin/dracula (thus firing the event before the autocommand is installed) that things still wouldn't work?

I'm in favor of keeping our setup a little simpler :)

stnley commented 2 years ago

@benknoble In my testing it did work as expected when lazy-loading and normal loading. However it seems like the consensus is to keep the setup as-is and direct user to implement their own autocmd when lazy-loading. That makes sense so I'll go ahead and close this.

Thank you both for looking into it!