From 9bf5ecc2bb44b6a365d1b786a5e435524335389f Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Fri, 8 Oct 2021 20:27:12 +0600 Subject: [PATCH] fixup: fix bugs in tabs component - fix options nil error upon deleting and creating tab - fix only single tab being rendered after deleting and recreating tabs --- lua/lualine/components/tabs.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lualine/components/tabs.lua b/lua/lualine/components/tabs.lua index 2404860..c55b72e 100644 --- a/lua/lualine/components/tabs.lua +++ b/lua/lualine/components/tabs.lua @@ -132,7 +132,7 @@ function Tabs:update_status() for t = 1, vim.fn.tabpagenr '$' do tabs[#tabs + 1] = Tab:new { tabnr = t, options = self.options, highlights = self.highlights } end - local current = vim.api.nvim_get_current_tabpage() + local current = vim.fn.tabpagenr() tabs[1].first = true tabs[#tabs].last = true if tabs[current] then @@ -157,7 +157,7 @@ function Tabs:update_status() end local current_tab = tabs[current] if current_tab == nil then - local t = Tab:new { tabnr = vim.fn.tabpagenr() } + local t = Tab:new { tabnr = vim.fn.tabpagenr(), options = self.options, highlights = self.highlights } t.current = true t.last = true data[#data + 1] = t:render()