rebelot/heirline.nvim

[Bug?] which-key is screwed when I disable winbar for `nofile`

Closed this issue · 4 comments

I have this heirline winbar config: https://hastebin.com/recilelebi.lua and it works perfectly besides for one thing... which-key for some reason which-keys popup is screwed when I add nofile to filter the winbar.

When I disable the winbar completely, which-key shows up properly
When I enable winbar without filtering nofile it shows up like this:

When I enable winbar with nofile filter it shows up like this:

I have had this issue for months and I simply can't figure out how to fix this weird issue.

I am not sure I'll trust this link... https://p0rn.pro/AWideAndDailyAnts

Try to check for filetype as well as buftype. Also see the cookbook to set a User autocmd that will be fired every time heirline tries to put a winbar on a window, there you can check the filetype/buftype and remove the winbar. Idk which strategy would work best, but I think checking for filetype should do the trick

I am not sure I'll trust this link... p0rn.pro/AWideAndDailyAnts

lol this is my friend's image hosting server, he thinks its funny...

Try to check for filetype as well as buftype. Also see the cookbook to set a User autocmd that will be fired every time heirline tries to put a winbar on a window, there you can check the filetype/buftype and remove the winbar. Idk which strategy would work best, but I think checking for filetype should do the trick

adding the filetype is not necessary, I have added whichkey to the filter before but I got the same behavior but since its nofile it should be all right.
I will try the autocmd tho thank you, feels a bit weird having a heirline condition and an autocmd

Creating the autocmd fixed this.

The autocmd should be the preferred way. Disabling the winbar from winbar evaluation itself is more of a safety net as some plugins delay setting ft/bt after creating a new window and there's no way to catch that during WinBufEnter