From a11f6d15d4d8c9ca9105838d3087ac6281bb6acc Mon Sep 17 00:00:00 2001 From: smhc Date: Sun, 2 Jan 2022 21:05:42 +1000 Subject: [PATCH] Schedule a redraw of tabline when setting tabline (#520) * Schedule a redraw of tabline when setting tabline The tabline isn't drawn until scrolling the window or opening another file. Opening multiple files at once (e.g. nvim a.txt b.txt) will only show the first. By performing a deferred redraw of the tabline this fixes this startup behaviour problem. * Changed to use vim.schedule --- lua/lualine.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lualine.lua b/lua/lualine.lua index 92039c0..4d2ea29 100644 --- a/lua/lualine.lua +++ b/lua/lualine.lua @@ -258,6 +258,9 @@ local function set_tabline() if next(config.tabline) ~= nil then vim.go.tabline = "%{%v:lua.require'lualine'.tabline()%}" vim.go.showtabline = 2 + vim.schedule(function() + vim.api.nvim_command('redrawtabline') + end) end end