Skip to content
smhc edited this page Jan 2, 2022 · 6 revisions

My tabline updates infrequently

Lualine itself doesn't trigger any statusline or tabline redraw. Instead when neovim tries to redraw tabline/statusline lualine provides what to redraw. And neovim doesn't update tabline very often. If you don't like the default behavior, you can trigger statusline redraw with :redrawstatus and tabline redraw with :redrawtabline. You can set a timer to update tabline every 1000ms with following snippet.

if _G.Tabline_timer == nil then
  _G.Tabline_timer = vim.loop.new_timer()
else
  _G.Tabline_timer:stop()
end
_G.Tabline_timer:start(0,             -- never timeout
                       1000,          -- repeat every 1000 ms
                       vim.schedule_wrap(function() -- updater function
                                            vim.api.nvim_command('redrawtabline')
                                         end))

To fix the tabline redraw only at startup (rather than every 1000ms), the below can be used:

vim.schedule(function()
  vim.api.nvim_command('redrawtabline')
end)
Clone this wiki locally