famiu / feline.nvim

A minimal, stylish and customizable statusline for Neovim written in Lua
GNU General Public License v3.0
1.04k stars 55 forks source link

[Bug] Winbar disappears from inactive pane #316

Closed matthias-Q closed 1 year ago

matthias-Q commented 1 year ago

Neovim version NVIM v0.8.0-v0.8.0 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3

Feline version Master with commit hash: 83fcde2

Describe the bug When components are specified in the winbar setup, the winbar disappears from the inactive pane.

To Reproduce Use the following config snippet:

local winbar_components = {
    active = {},
    inactive = {},
}

local wincomps = {

    file = {
        info = {
            provider = {
                name = "file_info",
                opts = {
                    type = "relative",
                    file_modified_icon = "",
                },
            },
            hl = { fg = colors.cyan },
            left_sep = " ",
        },
    }

}
table.insert(winbar_components.active, {})
table.insert(winbar_components.active, {})
table.insert(winbar_components.active, {})
table.insert(winbar_components.inactive, {})
table.insert(winbar_components.inactive, {})
-- Right section
table.insert(winbar_components.active[1], wincomps.file.info)

require("feline").winbar.setup
    {
        components = winbar_components,
    }
require("feline").setup()

Steps to reproduce the behavior:

  1. Create a split buffer with 2 files
  2. swap active panes
  3. winbar disappears from active pane

Expected behavior Winbar should always be visible. If the default setup is used, it works as expected.

Does this error occur in the minimal init file? Checked with the minimal config. See above.

And check if your issue still occurs.

Provide modified minimal_init.lua see above

Screenshots Screenshot_20221003_103316 Screenshot_20221003_1033311

Additional context Add any other context about the problem here (eg: other plugins that may conflict with this plugin, configuration options that you think might cause the issue, etc.).

famiu commented 1 year ago

The inactive winbar components table has no elements.. Why should Feline display anything on an inactive window if the inactive components table is empty? The solution is to just add the component you need to the inactive table

matthias-Q commented 1 year ago

I was expecting feline to follow the normal behavior of winbar, which shows the information even if the pane is not focused. I will try you suggestion though.

[EDIT] This did the trick, thanks,