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

[WIP]Add option tabline_always_visible #1137

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ require('lualine').setup {
},
ignore_focus = {},
always_divide_middle = true,
tabline_always_visible = true,
globalstatus = false,
refresh = {
statusline = 1000,
Expand Down Expand Up @@ -369,6 +370,9 @@ options = {
-- can't take over the entire statusline even
-- if neither of 'x', 'y' or 'z' are present.

tabline_always_visible = true, -- When set to false, tabline will be hidden
-- when there are less than two tab pages

globalstatus = false, -- enable global statusline (have a single statusline
-- at bottom of neovim instead of one for every window).
-- This feature is only available in neovim 0.7 and higher.
Expand Down
6 changes: 5 additions & 1 deletion lua/lualine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,11 @@ local function set_tabline(hide)
"call v:lua.require'lualine'.refresh({'kind': 'tabpage', 'place': ['tabline'], 'trigger': 'autocmd'})",
'lualine_tal_refresh'
)
modules.nvim_opts.set('showtabline', 2, { global = true })
if config.options.tabline_always_visible then
modules.nvim_opts.set('showtabline', 2, { global = true })
else
modules.nvim_opts.set('showtabline', 1, { global = true })
end
timers.halt_tal_refresh = false
else
modules.nvim_opts.restore('tabline', { global = true })
Expand Down
1 change: 1 addition & 0 deletions lua/lualine/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local config = {
tabline = 1000,
winbar = 1000,
},
tabline_always_visible = true,
},
sections = {
lualine_a = { 'mode' },
Expand Down