SmiteshP / nvim-navbuddy

A simple popup display that provides breadcrumbs feature using LSP server
Apache License 2.0
770 stars 30 forks source link

Black bar on right side of window for transparent themes #5

Closed LittleTealeaf closed 1 year ago

LittleTealeaf commented 1 year ago

This plugins is exactly what I need for my workflow, and I'm excited to work with it. However, there appears to be a black horizontal bar to the right of the popup menu

image

Which is more noticeable when using a smaller width.

For context, I use a transparent-background theme based on catppuccin, so for many plugins I just override the highlights. I've taken a look into the highlights used with this plugin (at least those that started with Navbuddy, but couldn't find any that caused this to happen.

Happy to try various tweaks/updates to figure this out.

SmiteshP commented 1 year ago

Ui drawing is completely handled by the nui library by @MunifTanjim. Not sure what might be the issue, let me try experimenting with transparance settings to see if I can reproduce this. Meanwhile, can you try setting border = "none" and see if this occurs in that case too?

LittleTealeaf commented 1 year ago

Setting border to none doesn't get rid of the black bar image I'll also take a look into nui configuration, maybe there's something there.

Just had a thought: could that be the scroll-bar?

SmiteshP commented 1 year ago

Just had a thought: could that be the scroll-bar?

Not sure nui has scroll bars, and if so I certainly didn't enable them. But if you are using some fancy GUI skin for neovim, that might actually be scroll bar added on.

LittleTealeaf commented 1 year ago

I think I've narrowed it down to something with Catppuccin's implementation of transparent backgrounds. I know they have integration with navic, but not with this given how new it is.

Another thought I had was that it's a shadow, but I tried overriding the FloatShadow and FloatShadowThrough highlights to no changes

MunifTanjim commented 1 year ago

https://github.com/SmiteshP/nvim-navbuddy/blob/61afbf6b2e7a86ff0c88a8535b51ea192146dfc7/lua/nvim-navbuddy/display.lua#L268-L272

https://github.com/SmiteshP/nvim-navbuddy/blob/61afbf6b2e7a86ff0c88a8535b51ea192146dfc7/lua/nvim-navbuddy/init.lua#L8-L23

Percentage doesn't always translate to fill-up the whole area (there can be fractional number). Instead of using size in the last box, try doing grow = 1, that'll fill up the remaining space. i.e.

            nui_layout.Box(right_popup, { grow = 1 }),
MunifTanjim commented 1 year ago

I think I've narrowed it down to something with Catppuccin's implementation of transparent backgrounds.

Yeah, that's also the issue here. Normally that black empty space should've been transparent. But this particular theme is rendering the empty space as black.

But the suggestion in my previous comment will make sure there's no empty space. So that should fix it.

SmiteshP commented 1 year ago

@LittleTealeaf Added fix as per @MunifTanjim's suggestion, can you check if it is fixed