utilyre / barbecue.nvim

Visual Studio Code inspired breadcrumbs plugin for the Neovim editor
MIT License
759 stars 31 forks source link

[FEAT]: auto-hide winbar when empty #75

Closed DanielFGray closed 1 year ago

DanielFGray commented 1 year ago

Requirements

Problem

sometimes when navigating, navic returns an empty string, and then theres an empty winbar covering up text

Solution Suggestion

when navic returns an empty string, the winbar should toggle its visibility

Workaround

No response

utilyre commented 1 year ago

I consciously made it behave like this so that the winbar won't toggle itself too much when navigating around. Do you have a use case for the feature you're suggesting?

DanielFGray commented 1 year ago

In some filetypes where there's no information from treesitter (eg sql) it just feels like wasted space.

I only just realized that the bar isnt "floating" but is instead pushing the viewport down a line..

I wonder if it would be possible to have an option to be shown in a floating window that that stays docked to the top, and could easily be toggled when empty without shifting the buffer around?

utilyre commented 1 year ago

I wonder if it would be possible to have an option to be shown in a floating window that that stays docked to the top, and could easily be toggled when empty without shifting the buffer around?

Neovim handles winbar highlights (where barbecue is) significantly different from buffer highlights (like a floating window), which is a huge obstacle to this solution because it'd need the whole project refactored to get it working.

DanielFGray commented 1 year ago

for whatever it's worth, I've switched to using navic directly in lualine, but I am missing the clickable feature of barbecue

utilyre commented 1 year ago

I've made barbecue go hidden when the language server doesn't provide any information (no textDocument/documentSymbol capability) and the dirname and basename parts are disabled.

Try bugfix/exclusion branch and see if this was what you wanted. Then I'll merge.

DanielFGray commented 1 year ago

I like this, it does help. I do wish it went a bit further, and also hid when eg on a blank line and theres nothing shown, but considering the limitations it seems this is as good as we can get. Thanks!