Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Component conditions not properly evaluation at launch #1209

Open
2 tasks done
MarcoBuess opened this issue Mar 17, 2024 · 0 comments
Open
2 tasks done

Bug: Component conditions not properly evaluation at launch #1209

MarcoBuess opened this issue Mar 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MarcoBuess
Copy link

Self Checks

  • I'm using the latest lualine.
  • I didn't find the issue in existing issues or PRs.

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
@MarcoBuess MarcoBuess added the bug Something isn't working label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant