Skip to content

Commit

Permalink
feat: add tabpage handle to tablist components
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Labeyrie committed Jan 26, 2023
1 parent af92254 commit d000fc1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lua/heirline/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ local function get_bufs()
end, nvim_list_bufs())
end

local function bufs_in_tab(tabnr)
tabnr = tabnr or 0
local function bufs_in_tab(tabpage)
tabpage = tabpage or 0
local buf_set = {}
local wins = vim.api.nvim_tabpage_list_wins(tabnr)
local wins = vim.api.nvim_tabpage_list_wins(tabpage)
for _, winid in ipairs(wins) do
local bufnr = vim.api.nvim_win_get_buf(winid)
buf_set[bufnr] = true
Expand All @@ -191,6 +191,7 @@ function M.make_tablist(tab_component)
self[i] = self:new(tab_component, i)
child = self[i]
child.tabnr = tabnr
child.tabpage = tabpage
end
if tabpage == vim.api.nvim_get_current_tabpage() then
child.is_active = true
Expand Down

0 comments on commit d000fc1

Please sign in to comment.