Skip to content

Commit 1fe6ed8

Browse files
committed
refactor(#2826): add lib.target_win_id to tabline
1 parent 0d975b4 commit 1fe6ed8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lua/nvim-tree/view.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ local TABPAGES = {}
99
--- Debugging only.
1010
--- Tabs show TABPAGES winnr and BUFNR_PER_TAB bufnr for the tab.
1111
--- Orphans for inexistent tab_ids are shown at the right.
12+
--- lib.target_winid is always shown at the right next to a close button.
1213
--- Enable with:
1314
--- vim.opt.tabline = "%!v:lua.require('nvim-tree.view').tab_line()"
1415
--- vim.opt.showtabline = 2
@@ -96,8 +97,8 @@ function M.tab_line()
9697
tl = tl .. " "
9798
end
9899

99-
-- close button
100-
tl = tl .. "|%#TabLine#%999X X |"
100+
-- target win id and close button
101+
tl = tl .. "|%#TabLine# twi" .. (require("nvim-tree.lib").target_winid or "?") .. " %999X| X |"
101102

102103
return tl
103104
end

0 commit comments

Comments
 (0)