@@ -87,7 +87,6 @@ function View:log_event(data, bufnr)
87
87
vim.api.nvim_get_current_tabpage() = %s\
88
88
vim.api.nvim_get_current_win() = %s\
89
89
self.bufnr_by_tabid = %s\
90
- globals.BUFNR_BY_TABID = %s\
91
90
globals.WINID_BY_TABID = %s\
92
91
vim.fn.win_findbuf(bufnr) = %s\
93
92
data = %s\
@@ -97,7 +96,6 @@ function View:log_event(data, bufnr)
97
96
vim .api .nvim_get_current_tabpage (),
98
97
vim .api .nvim_get_current_win (),
99
98
vim .inspect (self .bufnr_by_tabid , { newline = " " }),
100
- vim .inspect (globals .BUFNR_BY_TABID , { newline = " " }),
101
99
vim .inspect (globals .WINID_BY_TABID , { newline = " " }),
102
100
vim .inspect (vim .fn .win_findbuf (bufnr ), { newline = " " }),
103
101
vim .inspect (data , { newline = " " }),
179
177
--- @param bufnr integer
180
178
--- @return boolean
181
179
function View :matches_bufnr (bufnr )
182
- for _ , b in pairs (globals . BUFNR_BY_TABID ) do
180
+ for _ , b in pairs (self . bufnr_by_tabid ) do
183
181
if b == bufnr then
184
182
return true
185
183
end
@@ -208,8 +206,6 @@ function View:create_buffer(bufnr)
208
206
209
207
self .bufnr_by_tabid [tabid ] = bufnr
210
208
211
- globals .BUFNR_BY_TABID [tabid ] = bufnr
212
-
213
209
vim .api .nvim_buf_set_name (bufnr , " NvimTree_" .. tabid )
214
210
215
211
for _ , option in ipairs (BUFFER_OPTIONS ) do
@@ -544,14 +540,14 @@ end
544
540
function View :abandon_current_window ()
545
541
local tab = vim .api .nvim_get_current_tabpage ()
546
542
547
- globals . BUFNR_BY_TABID [tab ] = nil
543
+ self . bufnr_by_tabid [tab ] = nil
548
544
549
545
globals .WINID_BY_TABID [tab ] = nil
550
546
end
551
547
552
548
function View :abandon_all_windows ()
553
549
for tab , _ in pairs (vim .api .nvim_list_tabpages ()) do
554
- globals . BUFNR_BY_TABID [tab ] = nil
550
+ self . bufnr_by_tabid [tab ] = nil
555
551
globals .WINID_BY_TABID [tab ] = nil
556
552
end
557
553
end
628
624
--- @param tabid number | nil (optional ) the number of the chosen tabpage. Defaults to current tabpage.
629
625
--- @return integer ? winid
630
626
function View :winid (tabid )
631
- local bufnr = globals . BUFNR_BY_TABID [tabid ]
627
+ local bufnr = self . bufnr_by_tabid [tabid ]
632
628
633
629
if bufnr then
634
630
for _ , winid in pairs (vim .api .nvim_tabpage_list_wins (tabid or 0 )) do
653
649
function View :get_bufnr ()
654
650
local tab = vim .api .nvim_get_current_tabpage ()
655
651
656
- return globals . BUFNR_BY_TABID [tab ]
652
+ return self . bufnr_by_tabid [tab ]
657
653
end
658
654
659
655
function View :prevent_buffer_override ()
0 commit comments