nvim-lualine / lualine.nvim

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

Bug: How to make winbar always visible? #1271

Closed xuanhung1509 closed 4 weeks ago

xuanhung1509 commented 4 weeks ago

I'm migrating from barbecue.nvim to use native lualine's winbar support. So far, I'm quite happy with it after integrating with 'nvim-navic". The only issue that annoys me is that the winbar line disappears if I open a window from a plugin (Lazy/Mason...), making the editor shift up one line.

https://github.com/nvim-lualine/lualine.nvim/assets/89293664/f3356836-9fae-4e23-ac76-80c4fab3c8b2

Self Checks

How to reproduce the problem

Expected behaviour

Winbar line stays even if no content.

Actual behaviour

Winbar line disappears, making the editor shift up one line.

Minimal config to reproduce the issue

Additional information

shadmansaleh commented 4 weeks ago

As you can see in the docs there are to configuration items winbar and inactive_winbar which sets winbar for active and inactive windows respectively.

because you never set inactive_winbar lualine doesn't show winbars on inactive_windows.

 lualine.setup {
        winbar = {
          lualine_a = {
            { filepath },
          },
        },
        inactive_winbar = {
          lualine_a = {
            { filepath },
          },
        },
      }

if you want just the line to be shown in in active window you can just put a whitespace component in inactive_winbar

   inactive_winbar = {
    lualine_a = {
      function() return " " end
    }
  },
xuanhung1509 commented 4 weeks ago

Nice, I could not understand what the inactive_ does until now. Thank you!