From 1fe6ed858d2c45d7fb619f0e92ecd8dad082a1db Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Tue, 17 Jun 2025 16:38:47 +1000 Subject: [PATCH] refactor(#2826): add lib.target_win_id to tabline --- lua/nvim-tree/view.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/nvim-tree/view.lua b/lua/nvim-tree/view.lua index 89894e71..e32c0452 100644 --- a/lua/nvim-tree/view.lua +++ b/lua/nvim-tree/view.lua @@ -9,6 +9,7 @@ local TABPAGES = {} --- Debugging only. --- Tabs show TABPAGES winnr and BUFNR_PER_TAB bufnr for the tab. --- 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: --- vim.opt.tabline = "%!v:lua.require('nvim-tree.view').tab_line()" --- vim.opt.showtabline = 2 @@ -96,8 +97,8 @@ function M.tab_line() tl = tl .. " " end - -- close button - tl = tl .. "|%#TabLine#%999X X |" + -- target win id and close button + tl = tl .. "|%#TabLine# twi" .. (require("nvim-tree.lib").target_winid or "?") .. " %999X| X |" return tl end