-
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
Bug: showtabline is affected by seemingly irrelevant options #1294
Comments
This is really annoying. While it makes sense for the plugin to modify |
Removing the following autocmds: Lines 267 to 268 in b431d22
fixes the issue for me. vim.cmd.autocmd { 'lualine ColorScheme', bang = true }
vim.cmd.autocmd { 'lualine OptionSet background', bang = true } |
fixed with #1013 use |
@shadmansaleh Ideally, when |
A workaround is to set require('lualine').setup {
tabline = {
lualine_a = {
{
'buffers',
cond = function()
local cond = #vim.fn.getbufinfo { buflisted = 1 } > 1
vim.opt.showtabline = cond and 2 or 1
return cond
end,
},
},
},
} |
WTF, #1294 (comment) triggers this bug: #1141 |
I guess you could do something like this: require('lualine').setup {
tabline = {
lualine_a = {
{
'buffers',
cond = function()
if #vim.fn.getbufinfo { buflisted = 1 } > 1 then
if vim.opt.showtabline:get() ~= 2 then
vim.opt.showtabline = 2
end
return true
else
if vim.opt.showtabline:get() ~= 1 then
vim.opt.showtabline = 1
end
return false
end
end,
},
},
},
} But the solution in #1294 (comment) works fine at least on commit e9b935c (I haven't done a full bisect). |
@shadmansaleh |
Self Checks
How to reproduce the problem
I have a configuration that conditionally shows the tabline based on the number of open buffers. This is accomplished with auto commands that set the
showtabline
option. I would prefer to use lualine's builtincond
option, but even when no conditions are satisfied on any tabline segments, the tabline itself doesn't become hidden.I noticed that the value of
background
will influence the behavior of the tabline on startup. Ifbackground
is set todark
,showtabline
will eventually be set to2
. This is despiteshowtabline
being set to1
after lualine's setup and through the end of the configuration.Expected behaviour
The value of
background
shouldn't affectshowtabline
.Actual behaviour
When
background=light
,showtabline
isn't modified. Ifbackground=dark
(the default), sometime after startupshowtabline=2
.Minimal config to reproduce the issue
The text was updated successfully, but these errors were encountered: