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

feat: add option always_show_tabs to control whether show tabline when there are only one tab. #1013

Merged
merged 3 commits into from
Nov 1, 2024
Merged
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ require('lualine').setup {
},
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = false,
refresh = {
statusline = 1000,
Expand Down Expand Up @@ -378,6 +379,10 @@ options = {
-- can't take over the entire statusline even
-- if neither of 'x', 'y' or 'z' are present.

always_show_tabline = true -- When set to true, if you have configured lualine for displaying tabline
-- then tabline will always show. If set to false, then tabline will be displayed
-- only when there are more than 1 tab. (see :h showtabline)

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
2 changes: 1 addition & 1 deletion lua/lualine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ 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 })
modules.nvim_opts.set('showtabline', config.options.always_show_tabline and 2 or 1, { global = true })
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 @@ -18,6 +18,7 @@ local config = {
},
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = vim.go.laststatus == 3,
refresh = {
statusline = 1000,
Expand Down
1 change: 1 addition & 0 deletions tests/spec/lualine_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe('Lualine', function()
},
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = false,
refresh = {
statusline = 1000,
Expand Down
Loading