Skip to content

Commit d6cd465

Browse files
committed
refactor(#2826): winnr->winid consistently
1 parent b7e9789 commit d6cd465

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lua/nvim-tree/explorer/view.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,18 +578,18 @@ end
578578
---@param winid number|nil
579579
---@param open_if_closed boolean|nil
580580
function View:focus(winid, open_if_closed)
581-
local wnr = winid or self:get_winid(nil, "View:focus1")
581+
local wid = winid or self:get_winid(nil, "View:focus1")
582582

583-
if vim.api.nvim_win_get_tabpage(wnr or 0) ~= vim.api.nvim_win_get_tabpage(0) then
583+
if vim.api.nvim_win_get_tabpage(wid or 0) ~= vim.api.nvim_win_get_tabpage(0) then
584584
self:close(nil, "View:focus")
585585
self:open()
586-
wnr = self:get_winid(nil, "View:focus2")
586+
wid = self:get_winid(nil, "View:focus2")
587587
elseif open_if_closed and not self:is_visible() then
588588
self:open()
589589
end
590590

591-
if wnr then
592-
vim.api.nvim_set_current_win(wnr)
591+
if wid then
592+
vim.api.nvim_set_current_win(wid)
593593
end
594594
end
595595

lua/nvim-tree/multi-instance-debug.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local globals = require("nvim-tree.globals")
33
local M = {}
44

55
--- Debugging only.
6-
--- Tabs show TABPAGES winnr and BUFNR_PER_TAB bufnr for the tab.
6+
--- Tabs show TABPAGES winid and BUFNR_PER_TAB bufnr for the tab.
77
--- Orphans for inexistent tab_ids are shown at the right.
88
--- lib.target_winid is always shown at the right next to a close button.
99
--- Enable with:
@@ -33,10 +33,10 @@ function M.tab_line()
3333
-- tab_id itself
3434
tl = tl .. " t" .. tab_id
3535

36-
-- winnr, if present
36+
-- winid, if present
3737
local tp = globals.TABPAGES[tab_id]
3838
if tp then
39-
tl = tl .. " w" .. (tp.winnr or "nil")
39+
tl = tl .. " w" .. (tp.winid or "nil")
4040
else
4141
tl = tl .. " "
4242
end
@@ -67,7 +67,7 @@ function M.tab_line()
6767
end
6868
for tab_id, tp in pairs(tabpages) do
6969
orphans[tab_id] = orphans[tab_id] or {}
70-
orphans[tab_id].winnr = tp.winnr
70+
orphans[tab_id].winid = tp.winid
7171
end
7272

7373
-- right-align
@@ -78,9 +78,9 @@ function M.tab_line()
7878
-- inexistent tab
7979
tl = tl .. "%#error#| t" .. tab_id
8080

81-
-- maybe winnr
82-
if orphan.winnr then
83-
tl = tl .. " w" .. (orphan.winnr or "nil")
81+
-- maybe winid
82+
if orphan.winid then
83+
tl = tl .. " w" .. (orphan.winid or "nil")
8484
else
8585
tl = tl .. " "
8686
end

0 commit comments

Comments
 (0)