-
Notifications
You must be signed in to change notification settings - Fork 481
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
Conversation
always_show_tabs
.always_show_tabs
to control whether show tabline
when there are only one tab.
Works good... thanks |
Thanks for your feedback... Hope we can merge this patch ASAP... |
In the meantime you can use this snippet until this PR is merged: require('lualine').hide({place = {'tabline'}})
local lualine_tmp = vim.api.nvim_create_augroup('lualine_tmp', { clear = true })
vim.api.nvim_create_autocmd({ 'TabNew', 'TabClosed' }, {
group = lualine_tmp,
callback = function()
if vim.fn.tabpagenr('$') == 1 then
require('lualine').hide({place = {'tabline'}})
else
require('lualine').hide({place = {'tabline'}, unhide = true})
end
end,
}) Place this right after |
Actually, this snippet doesn't work, because when Here is my workaround way to make tabline = {
lualine_a = {
{ 'filetype', icon_only = true },
},
lualine_b = {
{ 'tabs', mode = 2, max_length = vim.o.columns },
{
function()
vim.o.showtabline = 1
return ''
--HACK: lualine will set &showtabline to 2 if you have configured
--lualine for displaying tabline. We want to restore the default
--behavior here.
end,
},
},
},
It might be expensive to constantly call |
You are not quite right. Lines 488 to 489 in 05d78e9
So if you have |
what’s the status of this? |
I hope it can be merged ASAP, or at least get some feedback. Since all the tests (except for those which are resulted in CI bugs) have passed. So currently I have to use my own workaround to bypass it. |
Any updates on this? |
lgtm. Thanks. Also sorry for the late reply. |
No description provided.