`disable_winbar_cb` not working for detecting buffer type
Closed this issue · 3 comments
mehalter commented
It seems like sometimes disable_winbar_cb
is running before the buffer type is able to be set. Specifically I can replicate this 100% of the time when it comes to terminal buffers.
Here is a minimal neovim configuration that replicates this:
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--branch=stable",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{
"rebelot/heirline.nvim",
opts = {
opts = {
disable_winbar_cb = function(args)
return vim.tbl_contains({ "terminal", "help" }, vim.bo[args.buf].buftype)
end,
},
winbar = {
provider = "SOME RANDOM TEXT",
},
},
},
})
Steps Reproduce
- Use the above
init.lua
file - run
nvim
and see "SOME RANDOM TEXT" inwinbar
- Open a help page (Ex.
:h news
) and see that thewinbar
is correctly disabled - run
:terminal
to open a new terminal buffer, see that thewinbar
is shown and not disabled when it should be.
Hopefully this is detailed enough to report this issue. Please let me know if you have any questions/need any more clarification !
rebelot commented
good call!
rebelot commented
if only there was a BufType
autocmd....
mehalter commented
For reals BufType
would be so nice