From 70dcc6f11d146919c8fceb827bb696d8b44215c4 Mon Sep 17 00:00:00 2001 From: Pranav Laxman Date: Tue, 9 Jan 2024 00:02:40 -0500 Subject: [PATCH] use nvim's internal numbering for tab index --- lua/cokeline/tabs.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/cokeline/tabs.lua b/lua/cokeline/tabs.lua index 7029dbe..75a158d 100644 --- a/lua/cokeline/tabs.lua +++ b/lua/cokeline/tabs.lua @@ -93,7 +93,8 @@ function M.fetch_tabs() table.sort(tabnrs, function(a, b) return a < b end) - for t, tabnr in ipairs(tabnrs) do + for _, tabnr in ipairs(tabnrs) do + local t = vim.api.nvim_tabpage_get_number(tabnr) if state.tab_lookup[tabnr] ~= nil then tabs[t] = state.tab_lookup[tabnr] tabs[t].is_active = tabnr == active_tab