nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
5.72k stars 455 forks source link

Bug: Component conditions not properly evaluation at launch #1209

Open MarcoBuess opened 3 months ago

MarcoBuess commented 3 months ago

Self Checks

How to reproduce the problem

Simple winbar with a simple component

winbar = {
    lualine_y = {
        {
            "%m %f",
            cond = function()
                return #vim.api.nvim_list_wins() > 1
            end
        },
    },
},
inactive_winbar = {
    lualine_y = {
        {
            "%m %f",
            cond = function()
                return #vim.api.nvim_list_wins() > 1
            end
        },
    },
},

Expected behaviour

  1. Condition should only show winbar when more than 1 window is open.
  2. Condition should be evaluated at launch.

Actual behaviour

It looks like the condition is only evaluated after the first refresh cycle. Once lualine launches the filename and state is shown. Then after a couple of seconds it disappears. It is working as intended afterwards.

Minimal config to reproduce the issue

Additional information

OS Name:    Microsoft Windows 10 Enterprise
OS Version: 10.0.19045 N/A Build 19045
-------------------------------------------
NVIM v0.9.5
Build type: RelWithDebInfo
LuaJIT 2.1.1703942320
-------------------------------------------
lualine
branch master
commit af4c3cf