marko-cerovac / material.nvim

:trident: Material colorscheme for NeoVim written in Lua with built-in support for native LSP, TreeSitter and many more plugins
GNU General Public License v2.0
996 stars 131 forks source link

Default notify configration has colour issues. #211

Closed bhaumik-tripathi closed 1 month ago

bhaumik-tripathi commented 1 month ago

First of all, thank you for creating this awesome colorscheme, it's just perfect, as a scope of improvement there is some colour issues in notify's default config when enabled from this themes setup function.

Steps to reproduce!

  1. Setup this theme and uncommenting notify plugin in plugins(make sure it is installed and in use for some notifications to test).
  2. Secondly, enable non_current_windows = true.
  3. Now you may notice that if the notification is triggered on a file that is in focus, then there is background colour differences that looks odd. NOTE: This doesn't happen if nvim-notify is commented in plugins of setup.
    1. Clip showing color diff if enabled
    2. Clip showing no color diff if disabled

It is also important to note that if the underlying file is not in focus, the default background of notify is different from the color of non-focused file. So, I can say that the default background color of notify when plugins = {'nvim-notify'} is set in setup corresponds to the dark background color of non focused files, also when the 2nd set is done, the lighter background which happens to show contrast creates the background color differences with the notification. I am not sure of the internal functionalities but you would somehow need to decide the background color depending if the underlying file is in focus or not if non_current_windows = true` is set.

marko-cerovac commented 1 month ago

I'm trying to reproduce. This looks to me like an issue with another setting. Did you by any chance enable contrast for floating windows with floating_windows=true?

bhaumik-tripathi commented 1 month ago

Hey @marko-cerovac , floating_windows= true was indeed enabled and on making it false the color difference goes away if nvim-notify is uncommented in plugins of material settings and the underlying file is on focus. I was not sure but now it seems like notify uses floating windows probably to render the notifications. But, even after that if non_current_windows = true is set the notification window is showing color diff if the underlying file is not in focus. For better clarity afterwards these are the options I have tweaked.

{
terminal = false,
    sidebars = true, 
    floating_windows = false,
    cursor_line = true,
    lsp_virtual_text = true,
    non_current_windows = true, 
}
marko-cerovac commented 1 month ago

Yes, nvim-notify notifications use floating window background because they are floating windows. If you uncomment nvim-notify from your settings, you will also get this difference when the file is not in focus (the notifications will be lighter then the background). You can't get them to always have the same color as the background with the default settings. In part, that's because they shouldn't. The option to highlight non current windows is used to signify which window pane is in focus, but floating windows like notifications are a special case because they can't be focused on and neovim doesn't apply this background change to them. They just have one background color and that's it.

If you really really want them to always have the same background as the window behind them, you can do the following:

bhaumik-tripathi commented 1 month ago

The option to highlight non current windows is used to signify which window pane is in focus, but floating windows like notifications are a special case because they can't be focused on and neovim doesn't apply this background change to them.

Correct, I got your point, the current settings matches more with the philosophy and seems correct to me too. Thanks, for the clarification. Rather, As you suggested if I want I can also create a autocmd for that, but there is no issue with this setting too for me.