famiu/feline.nvim

[Bug] Actually disable winbar when using `disable` option

folliehiyuki opened this issue · 3 comments

Neovim version

NVIM v0.8.0
Build type: MinSizeRel
LuaJIT 2.1.0-beta3
Compiled by buildozer@build-edge-x86_64

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Feline version
master branch

Describe the bug
Unlike statusline, when adding filetypes to disable.filetypes list (e.g. NvimTree) I expect the winbar to not be there at all instead of an empty winbar.

To Reproduce

require('feline').winbar.setup {
    components = {
        active = {
             {
                 { provider = "Hello" },
             },
        },
    },
    disable = {
        filetypes = { 'NvimTree' },
    }
}

Expected behavior
The winbar is completely gone in the defined buffer.

Does this error occur in the minimal init file?

Provide modified minimal_init.lua

Screenshots
There is a blank line on the top (the winbar) of NvimTree buffer.

2022-10-04-224214_grim

Additional context
Looking briefly at the code it is returning an empty string. I think it should return nil in the winbar case.

https://github.com/feline-nvim/feline.nvim/blob/5d6a054c476f2c2e3de72022d8f59764e53946ee/lua/feline/generator.lua#L533-L535

famiu commented

This would not work as it is not allowed by Neovim to disable winbar on a per-window basis.

Thanks for answering!

Would it be ok for feline.nvim to support setting winbar through autocmd with window option vim.wo.winbar (instead of setting it globally)? This way I can achieve the same result.

famiu commented

Thanks for answering!

Would it be ok for feline.nvim to support setting winbar through autocmd with window option vim.wo.winbar (instead of setting it globally)? This way I can achieve the same result.

That would be an antipattern. Plus there's already plans to add support for selectively disabling winbar for Neovim, so let's wait for that