j-hui / fidget.nvim

💫 Extensible UI for Neovim notifications and LSP progress messages.
MIT License
1.98k stars 58 forks source link

Support transparent backgrounds #11

Closed augustocdias closed 2 years ago

augustocdias commented 2 years ago

Is it possible to add the possibility to add transparency or choose the color for the background? As you can see in the print bellow the background is quite different from the one from nvim.

image

j-hui commented 2 years ago

For highlighting, I just link FidgetTask to LineNr and FidgetTitle to Title. Have you defined a background color for either of these?

You should now be able to override this highlight link following resolution of #6

ahmedelgabri commented 2 years ago

I tried this & still can't get rid of background.

Screenshot 2022-01-26 at 23 22 51
hi! FidgetTitle ctermbg=NONE guibg=NONE
hi! FidgetTask ctermbg=NONE guibg=NONE
j-hui commented 2 years ago

Tha's odd. I'm not doing anything in my plugin to define the background color. If anything, I'm setting winblend to 100, so there really should be no background.

A few questions:

What does running :hi FidgetTask and :hi FidgetTitle show?

What colorscheme are you currently using?

Have you set termguicolors? If not, does the problem still persist with set termguicolors?

augustocdias commented 2 years ago

I get FidgetTitle xxx links to Title and FidgetTask xxx links to NonText.

I'm using tokyo-night and termguicolors is set

ahmedelgabri commented 2 years ago

What does running :hi FidgetTask and :hi FidgetTitle show?

Same as @augustocdias

What colorscheme are you currently using?

I'm using https://github.com/andreypopp/vim-colors-plain

Have you set termguicolors? If not, does the problem still persist with set termguicolors?

Yes, I have it set.

folliehiyuki commented 2 years ago

Issue transfered from #6, probably related:

My fidget appears darker or brighter than the defined colors on different buffers. Here are the screenshots:

1

2

mcauley-penney commented 2 years ago

Setting winblend to 0 made my popup completely transparent. Kinda odd

edit: forgot to mention, line 123 is the relevant change

image

j-hui commented 2 years ago

23 (which superceded #22; thanks @axieax!) adds a window.blend option, among other things. Does this fix everyone's transparency issues?

ahmedelgabri commented 2 years ago

Yup, works fine for me. Thanks @j-hui

folliehiyuki commented 2 years ago

I set winblend = 0 and the colors seem ok now. Thanks!

alex-popov-tech commented 2 years ago

works for me with {'j-hui/fidget.nvim', config = function() require('fidget').setup({ window = { winblend = 0 }}) end}

joshzcold commented 2 years ago

For future reference if you have autocmd vimenter * hi Normal guibg=none guifg=none in your config to make vim have a transparent background it will also cause fidget to have a black background.

For now I just matched my terminal editors background autocmd vimenter * hi Normal guibg=#202020

prurph commented 1 year ago

Is anyone still running into this? Regardless of what I've tried with highlight groups and the winblend option, the colors always appear much darker in fidget than they are in the actual theme/highlight setting. The background is transparent, however.

Iskustvo commented 1 year ago

Edit

Nevermind this, just read the comment below.

Original comment

Hi everyone! Like @prurph, I can also often reproduce this issue (same as @FollieHiyuki posted, with dimmed highlights in some buffers, even for same instance of LSP/fidget), so I think it should be reopened.

I've been trying to analyze it for some time now and here is my summary (it might be useful to someone):

While it also happened to me when opening just 1 Lua file with sumneko_lua LSP, I would suggest the following as best way to initially reproduce the issue:

Iskustvo commented 1 year ago

Silly me! After reading #32, it became more apparent. This issue actually happens when fidget is drawn below last line in file.

This makes reproduction easy:

Maybe linking fidget highlights to some more persistent highlights (if there are such) by default would be better.

jasonjurotich commented 1 year ago

Still having a problem with this. Used everything below, but nothing happens. I would suggest just leaving blend as 0 in the future.

use({ "j-hui/fidget.nvim", config = function() require("fidget").setup({ window = { blend = 0, relative = "editor", }, }) end, tag = "legacy", })

ghost commented 2 months ago

Just in case anyone needs this - this is how I sorted the transparent background:

{
  "j-hui/fidget.nvim",
  opts = {
    notification = {
      window = {
        winblend = 0,
      },
    },
  },
},