Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] transparent background for popups (telescope, mason...) #48

Closed
baggiponte opened this issue Mar 15, 2023 · 25 comments · Fixed by #107
Closed

[ENH] transparent background for popups (telescope, mason...) #48

baggiponte opened this issue Mar 15, 2023 · 25 comments · Fixed by #107
Assignees
Labels
Enhancement New feature, request or suggestion

Comments

@baggiponte
Copy link

Congrats for the theme, colors are awesome and the setup straightforward (I am mostly using gruvbox-material, which is vimscript so a little less straightforward to use). However, I was expecting that the transparency option would make popup windows bg transparent as well. I am no colorscheme expert, but I'd be glad to help!

@AlexvZyl
Copy link
Owner

Glad you like it!

I agree with you, should definitely add an option to do that. The only possible issue I am aware of, is that some of the plugins (for example, lspsaga.nvim) handle window transparency separately from the the Neovim settings. But I do not have a problem with extending support to handle the plugins.

The work has slightly slowed down, since I am grinding to get my thesis submitted. But after that I am going to add some stuff, including this.

@AlexvZyl AlexvZyl self-assigned this Mar 15, 2023
@AlexvZyl AlexvZyl added the Enhancement New feature, request or suggestion label Mar 15, 2023
@baggiponte
Copy link
Author

I will have a look around and try to find a solution 💪🏼

@AlexvZyl
Copy link
Owner

AlexvZyl commented Oct 14, 2023

I think this might be fixed with #97.

@baggiponte
Copy link
Author

baggiponte commented Oct 14, 2023

Will try it soon! EDIT: how can I try the preview?

@AlexvZyl
Copy link
Owner

You should be able to set the branch you use with your plugin manager. Currently it is on dev. Should be merged in relatively soon though.

@AlexvZyl
Copy link
Owner

AlexvZyl commented Jan 3, 2024

I think my latest merge fixed this, but I am not sure. Please let me know if this is still an issue.

@baggiponte
Copy link
Author

Hey there! Will check when I have time later this week. Thanks for pinging me :)

@baggiponte
Copy link
Author

Hey there, tried running colorscheme nordic with the latest commit from the main branch and got this error:

11:38:07 msg_show   colorscheme nordic E5108: Error executing lua .../.local/share/nvim/lazy/nordic.nvim/lua/nordic/utils.lua:114: attempt to perform arithmetic on local 'c_fg' (a nil value)
stack traceback:
	.../.local/share/nvim/lazy/nordic.nvim/lua/nordic/utils.lua:114: in function 'blend_channel'
	.../.local/share/nvim/lazy/nordic.nvim/lua/nordic/utils.lua:118: in function 'blend'
	...l/share/nvim/lazy/nordic.nvim/lua/nordic/colors/init.lua:32: in function 'extend_palette'
	...a/.local/share/nvim/lazy/nordic.nvim/lua/nordic/init.lua:17: in function 'load'
	[string ":lua"]:1: in main chunk

@AlexvZyl
Copy link
Owner

AlexvZyl commented Jan 4, 2024

That is odd. Can you show me your setup (if any) and package manager config?

@5-pebbles
Copy link
Collaborator

5-pebbles commented Jan 4, 2024

I think this is the same thing I am running in to:

    C.bg = (O.transparent_bg and C.none) or C.gray0
    C.bg_dark = (O.transparent_bg and C.none) or C.black0
    C.bg_highlight = U.blend(C.bg_dark, C.bg, O.cursorline.blend) -- Line 32 colors init

Its trying to blend, 'NONE' which is not a hex value.
However, I don't get an error unless I change the default value of transparent_bg to true.

I don't know why baggiponte would be getting this.

If this is a bug I can make a pr and fix it, by making blend handle none or just skipping the blending function if none is used.

the error I get is:

Failed to run `config` for nordic

...El/.config/nvim/git/bin/nordic.nvim/lua/nordic/utils.lua:114: attempt to perform arithmetic on local 'c_fg' (a nil value)

# stacktrace:
  - git/bin/nordic.nvim/lua/nordic/utils.lua:114 _in_ **blend_channel**
  - git/bin/nordic.nvim/lua/nordic/utils.lua:118 _in_ **blend**
  - git/bin/nordic.nvim/lua/nordic/colors/init.lua:33 _in_ **extend_palette**
  - git/bin/nordic.nvim/lua/nordic/init.lua:17 _in_ **load**
  - lua/core/lazy.lua:61 _in_ **config**
  - lua/core/lazy.lua:305
  - lua/core/init.lua:4
  - init.lua:1

@AlexvZyl
Copy link
Owner

AlexvZyl commented Jan 4, 2024

Oh, yeah, I am blending a 'none' value. Oops.

We can just have the blend function return none when we try and blend a none value.

You can make a PR if you want? I will merge it asap.

@AlexvZyl
Copy link
Owner

AlexvZyl commented Jan 4, 2024

Thanks for finding the bug @5-pebbles! :)

@AlexvZyl
Copy link
Owner

AlexvZyl commented Jan 4, 2024

This should have been caught in the tests. We need to cover it.

@AlexvZyl
Copy link
Owner

AlexvZyl commented Jan 4, 2024

I just went ahead and fixed it, I don't want people's neovim breaking because of a colorscheme.

@baggiponte
Copy link
Author

Error fixed! About the transparency:

image

There's something off with the borders. Mason and Lazy popup are not transparent too. How can I help you with this?

@AlexvZyl
Copy link
Owner

AlexvZyl commented Jan 5, 2024

Ah, makes sense. Will fix this on Sunday.

@baggiponte
Copy link
Author

Another very minor thing: the pane separator is black and the NvimTree separator is white. Could they be made the same? Another unrequested opinion: with transparency, using black as a line separator feels weird. How can I change it to idk gray? Thanks :)

@5-pebbles
Copy link
Collaborator

5-pebbles commented Jan 6, 2024

For the blend, I will make a pr to just use the non-none color.
and then I will revert https://github.com/5-pebbles/nordic.nvim/commit/ea86462fa8fdeab9037300b7236e6e01f2d048ff for #101

@AlexvZyl
Copy link
Owner

AlexvZyl commented Jan 12, 2024

Another very minor thing: the pane separator is black and the NvimTree separator is white. Could they be made the same? Another unrequested opinion: with transparency, using black as a line separator feels weird. How can I change it to idk gray? Thanks :)

All valid concerns. Just thought about the black separator...

Can you please open a new issue?

@AlexvZyl
Copy link
Owner

Also, could you check on the dev branch if your border issue is resolved?

@baggiponte
Copy link
Author

Can you please open a new issue?

Ops sorry completely missed that. will do.

Also, could you check on the dev branch if your border issue is resolved?

It seems something changed indeed. The color's still dark (should be gray or white or the same as the highlight used by noice?) but at least it's not the "rectangle" it was before.

image

@AlexvZyl
Copy link
Owner

Enable bright borders and see if that is what you want? Share a screenshot, I am curious.

@baggiponte
Copy link
Author

Uuh didn't see that in the readme, that looks great! :)

image

@baggiponte
Copy link
Author

baggiponte commented Jan 13, 2024

Unrelated: do you know what highlights I can change to have a rounded border around this completion menu? It should be nvim-cmp's cmdline source. It does not work with my other theme of choice, gruvbox-material:

nordic
image

gruvbox-material

Unrelated: do you know what highlights I can change to have a rounded border around this completion menu? It should be

image

@AlexvZyl
Copy link
Owner

This should help you out :)

https://github.com/AlexvZyl/nvim/blob/main/lua%2Falex%2Flang%2Fcompletion%2Fcmdline.lua

AlexvZyl added a commit that referenced this issue Jan 14, 2024
* Fix(palette): Extend if required before theme is loaded

* Ref(utils): Reduce reliance on strings

Squash me

* Fix: Transparent background for floating border

See #48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature, request or suggestion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants