dark-notify icon indicating copy to clipboard operation
dark-notify copied to clipboard

Breaks some other highlight plugins

Open erikw opened this issue 2 years ago • 2 comments

First, thanks for this great plugin. I very much enjoy not having to manually toggle all vim instances when the system mode changes!

Lately I've came across at least three plugins that does something with text highlighting that does not work super great with dark-notify.

  • hlargs.nvim/ Highlight not working if dark-notify is enabled. There was a workaround found at https://github.com/m-demare/hlargs.nvim/issues/37#issuecomment-1237780276 which is to set this other plugin up in the onchange method.
  • nvim-cursorline Highlight is not working when dark-notify is enabled. However the above trick of loading this plugin in the onchange method did not work in this case.
  • vim-illuminate Same as above; the trick did not work.

Would it be possible to make this plugin more compatible by default with other plugins? Or would you have an idea on how to work around using any of the two latter plugins above together with dark-notify?

I'm on Neovim v0.7.2.

Thanks in advance!

erikw avatar Sep 13 '22 14:09 erikw

Making dark-notify "more compatible by default" is not really possible. Literally all it's doing is changing the colorscheme. If plugins cannot handle a change in colorscheme, that's their fault. Unfortunately this is simply very common, so I built the onchange feature. You will have to figure out for yourself how to "refresh" various plugins, but I would consider it a bug in many plugins if they don't do it automatically. If you file bugs on them, you do not have to mention dark-notify. Just say "how do I make your plugin respond to colorscheme changes like it should".

For nvim-cursorline, I read the source code, and it seems to set the highlight in a VimEnter autocommand. Why would it do that? I think that's just a dumb approximation for "do this once": a perfect manifestation of vim plugin authors' collective delusion that nobody ever changes the colorscheme outside their vimrc. Maybe try changing this autocommand to au ColorScheme *. I think that's a thing.

cormacrelf avatar Oct 05 '22 13:10 cormacrelf

One more thing, I am not sure if many people are aware of this but colorscheme changes always clear all highlight groups. It's a bulldozer.

cormacrelf avatar Oct 05 '22 13:10 cormacrelf