eldritch-theme / eldritch.nvim

A theme for the Ancient Ones! (NVIM)
MIT License
172 stars 6 forks source link

No bg for NotifyBackground #4

Closed GiyoMoon closed 5 months ago

GiyoMoon commented 6 months ago

Hey! I just saw your theme on the neovim subreddit and wanted to give it a try. Looks awesome!

I got this warning from the nvim-notify plugin (only appears after a notification is shown): image I use the default config with require('eldritch').setup(). Thanks for your help!

jacobrreed commented 6 months ago

I'll look into, although ive seen this with other themes as well

GiyoMoon commented 6 months ago

Thanks! I've used catppuccin, tokyonight and the lua port of everforest before and I haven't seen it happen.

jacobrreed commented 6 months ago

ya interesting ill look at catppucin and everforest, this theme actually forked from tokyonight, and I have the highlight defined for NotifyBackground so let me look around and see

jacobrreed commented 6 months ago

image ya im getting the same thing with catpuccin and tokyonight

jacobrreed commented 6 months ago

I can add something to the docs for people to add to notify, but im not sure any other way around it, it doesnt seem to respect the NotifyBackground highlight group

jacobrreed commented 6 months ago

oddly enough if you set the background_colour to any color, my highlight group takes over, it seems like some weird race condition that shoots the notification off, even though colorscheme with priority=1000 will load way before, i'll file an issue and ask in notify's repo

jacobrreed commented 6 months ago

https://github.com/rcarriga/nvim-notify/issues/264 filed issue here, for now you can set any color in Notify's config using

background_color = "#000000"
GiyoMoon commented 6 months ago

interesting. thanks for looking into this!

Normanras commented 6 months ago

Came here cause I was getting the same issue. What's interesting is in some buffers, when I switch to visual mode, I get no background/highlight color at all. Setting bg to #00000 does indeed trigger Eldritch's red color to begin showing up, but I thought it was strange that I didn't see a bg/highlight color when opening a new buffer.

jacobrreed commented 6 months ago

Came here cause I was getting the same issue. What's interesting is in some buffers, when I switch to visual mode, I get no background/highlight color at all. Setting bg to #00000 does indeed trigger Eldritch's red color to begin showing up, but I thought it was strange that I didn't see a bg/highlight color when opening a new buffer.

Can you screenshot? This seems unrelated to Notify's background color issue unless I'm misunderstanding

akthe-at commented 6 months ago

I can not reproduce this issue. I am using Neovim Nightly, on Windows OS -- no WSL2, Here is my config to setup Eldritch.nvim:

  {
    "eldritch-theme/eldritch.nvim",
    priority = 1000,
    opts = {},
    config = function()
      require("eldritch").setup({
        dim_inactive = true,
        transparent = true,
        hide_inactive_statusline = true,
        lualine_bold = true,
      })
      vim.o.termguicolors = true
    end,
  },

Can anyone confirm if this issue still persists with this sort of setup call? @jacobrreed @Normanras @GiyoMoon

GiyoMoon commented 6 months ago

yes this issue still persists, even with this setup() call

akthe-at commented 6 months ago

I am trying to think of other differences...I am using Wezterm Terminal, I have tried this with and without a background image or background color set in the terminal as well. Do you use any neovim plugins that try to set transparency?

GiyoMoon commented 6 months ago

I don't think so. I went and disabled all plugins and configurations apart from noice and the theme and it still happens :/

jacobrreed commented 6 months ago

I tried with tokyonight and same thing happens. If you don't set a color for notify explicitly, it warns you on startup but then immediately switches to the correct color. I filed a big but no response yet

jacobrreed commented 6 months ago

It does seem like it's a race condition, most likely because theme starts up with priority, for me at least, the notify warning shows up but still uses the background like it should. Then any subsequent calls to notify no longer have warning and honor colors, is this the same for everyone else? The workaround here is just setting any color as the background_colour option for notify

jacobrreed commented 5 months ago

Fixed with above merge, thanks @akthe-at

sbmueller commented 4 months ago

Hi, I see NotifyBackground is set in the code, but I still get the warning. Any ideas why that might happen? When I set transparent = true, the warning is gone, but also all hover elements have a black rectangle background.

EDIT: Investigation shows that colors.bg_float is correctly set in colors.lua but is nil in theme.lua. Maybe the issue is that colors.lua gets evaluated after theme.lua and when the value is referenced in the latter, it is still a nil value?