Closed cprn closed 8 months ago
you also need to set winbar to nothing with goyo for some reason?
vim.api.nvim_create_autocmd('User', {
desc = 'Enable LimeLight on GoYo enter',
group = goyo_group,
pattern = 'GoyoEnter',
callback = function()
require("lualine").hide()
vim.o.winbar = ''
-- also hide tabline
-- vim.o.showtabline = 0
vim.cmd('Limelight')
end,
})
vim.api.nvim_create_autocmd('User', {
desc = 'Disable LimeLight on GoYo leave',
group = goyo_group,
pattern = 'GoyoLeave',
callback = function()
-- reshow tabline
-- vim.o.showtabline = 2
require("lualine").hide({unhide = true})
vim.cmd('Limelight!')
end,
})
Yup, when I unset vim.o.winbar
it works - thank you very much!
My issue is solved but can you tell if it's a bug in Lualine or Goyo? Should I leave the ticket open?
I think it might be intended in Goyo to allow a winbar, because it might help with locating scopes with something like novic. U can ask if it's intended there in an issue if u want.
I am also not really sure why lualine doesn't unset winbar.
I think i found the issue lualine doesn't reset an option,if it didn't set it before. And the global winbar option is set implicitly whenever lualine sets the local option.
~~If i understand what is happening correctly: The global winbar stays when goyo creates new tab. lualine doesn't reset the global winbar because it doesn't know that set it before by setting the window local option in the other tab.~~ Never mind i am not sure why the global option transfers to the Goyo window.
We are resetting the options that we set when lualine is instructed to hide itself. I don't think we should be touching options that we haven't set. This issue should probably be fixed on goyos side. I'm also not really sure why it's happening though.
Self Checks
How to reproduce the problem
I apologize, it's not an isolated issue - it only happens when I use Goyo with Lualine but I'm asking for help because I can't put my finger on it. I tried to make it as easy to analyze as possible.
init.lua
:Goyo
.Expected behaviour
Both statusline and winbar gone.
Actual behaviour
Only statusline gone.
Minimal config to reproduce the issue
Additional information
Again, sorry it's not an isolated case - I'll totally get it if you just close it. I'm having trouble isolating what's the root cause. I'm guessing it has something to do with Goyo using two extra vertical buffers to center the main buffer but I can't figure it out.
Screenshot:![image](https://github.com/nvim-lualine/lualine.nvim/assets/6132708/8aa010dc-7eeb-4c99-ba47-b46f5a0b5296)