refactor(#2826): add lib.target_win_id to tabline

This commit is contained in:
Alexander Courtis 2025-06-17 16:38:47 +10:00
parent 0d975b4cb4
commit 1fe6ed858d

View File

@ -9,6 +9,7 @@ local TABPAGES = {}
--- Debugging only. --- Debugging only.
--- Tabs show TABPAGES winnr and BUFNR_PER_TAB bufnr for the tab. --- Tabs show TABPAGES winnr and BUFNR_PER_TAB bufnr for the tab.
--- Orphans for inexistent tab_ids are shown at the right. --- Orphans for inexistent tab_ids are shown at the right.
--- lib.target_winid is always shown at the right next to a close button.
--- Enable with: --- Enable with:
--- vim.opt.tabline = "%!v:lua.require('nvim-tree.view').tab_line()" --- vim.opt.tabline = "%!v:lua.require('nvim-tree.view').tab_line()"
--- vim.opt.showtabline = 2 --- vim.opt.showtabline = 2
@ -96,8 +97,8 @@ function M.tab_line()
tl = tl .. " " tl = tl .. " "
end end
-- close button -- target win id and close button
tl = tl .. "|%#TabLine#%999X X |" tl = tl .. "|%#TabLine# twi" .. (require("nvim-tree.lib").target_winid or "?") .. " %999X| X |"
return tl return tl
end end