diff options
| author | triethyl <triethylammonium@pm.me> | 2025-08-30 11:08:35 -0400 |
|---|---|---|
| committer | triethyl <triethylammonium@pm.me> | 2025-08-30 11:08:35 -0400 |
| commit | a8b4e24f908452a23dc9b559948461e080a6ce22 (patch) | |
| tree | 2af3d2497dcc0a19e3a2d0afa42d55415ecc30a9 /pkgs/custom-neovim/config/lua/statusline.lua | |
| parent | a4de06f681ac3d1b9f57d40cc34da31c514d261b (diff) | |
neovim: misc changes and fixes
Diffstat (limited to 'pkgs/custom-neovim/config/lua/statusline.lua')
| -rw-r--r-- | pkgs/custom-neovim/config/lua/statusline.lua | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/pkgs/custom-neovim/config/lua/statusline.lua b/pkgs/custom-neovim/config/lua/statusline.lua index fd246ba..f5fb20f 100644 --- a/pkgs/custom-neovim/config/lua/statusline.lua +++ b/pkgs/custom-neovim/config/lua/statusline.lua @@ -234,14 +234,23 @@ components.tab_counter = function (args) local before = args.before or "" local after = args.after or "" - local num_tabs = #vim.api.nvim_list_tabpages() - local current_tab = vim.api.nvim_get_current_tabpage() + local tab_list = vim.api.nvim_list_tabpages() + local num_tabs = #tab_list + local current_tab_name = vim.api.nvim_get_current_tabpage() + + local current_tab_index = 1 + + for i = 1, #tab_list, 1 do + if tab_list[i] == current_tab_name then + current_tab_index = i + end + end if num_tabs == 1 then return "" end local icon = use_icons and " " or "tab: " - return before..icon..current_tab.."/"..num_tabs..after + return before..icon..current_tab_index.."/"..num_tabs..after end -- Define Statusline |
