@@ -87,7 +87,6 @@ function View:log_event(data, bufnr)
8787 vim.api.nvim_get_current_tabpage() = %s\
8888 vim.api.nvim_get_current_win() = %s\
8989 self.bufnr_by_tabid = %s\
90- globals.BUFNR_BY_TABID = %s\
9190 globals.WINID_BY_TABID = %s\
9291 vim.fn.win_findbuf(bufnr) = %s\
9392 data = %s\
@@ -97,7 +96,6 @@ function View:log_event(data, bufnr)
9796 vim .api .nvim_get_current_tabpage (),
9897 vim .api .nvim_get_current_win (),
9998 vim .inspect (self .bufnr_by_tabid , { newline = " " }),
100- vim .inspect (globals .BUFNR_BY_TABID , { newline = " " }),
10199 vim .inspect (globals .WINID_BY_TABID , { newline = " " }),
102100 vim .inspect (vim .fn .win_findbuf (bufnr ), { newline = " " }),
103101 vim .inspect (data , { newline = " " }),
179177--- @param bufnr integer
180178--- @return boolean
181179function View :matches_bufnr (bufnr )
182- for _ , b in pairs (globals . BUFNR_BY_TABID ) do
180+ for _ , b in pairs (self . bufnr_by_tabid ) do
183181 if b == bufnr then
184182 return true
185183 end
@@ -208,8 +206,6 @@ function View:create_buffer(bufnr)
208206
209207 self .bufnr_by_tabid [tabid ] = bufnr
210208
211- globals .BUFNR_BY_TABID [tabid ] = bufnr
212-
213209 vim .api .nvim_buf_set_name (bufnr , " NvimTree_" .. tabid )
214210
215211 for _ , option in ipairs (BUFFER_OPTIONS ) do
@@ -544,14 +540,14 @@ end
544540function View :abandon_current_window ()
545541 local tab = vim .api .nvim_get_current_tabpage ()
546542
547- globals . BUFNR_BY_TABID [tab ] = nil
543+ self . bufnr_by_tabid [tab ] = nil
548544
549545 globals .WINID_BY_TABID [tab ] = nil
550546end
551547
552548function View :abandon_all_windows ()
553549 for tab , _ in pairs (vim .api .nvim_list_tabpages ()) do
554- globals . BUFNR_BY_TABID [tab ] = nil
550+ self . bufnr_by_tabid [tab ] = nil
555551 globals .WINID_BY_TABID [tab ] = nil
556552 end
557553end
628624--- @param tabid number | nil (optional ) the number of the chosen tabpage. Defaults to current tabpage.
629625--- @return integer ? winid
630626function View :winid (tabid )
631- local bufnr = globals . BUFNR_BY_TABID [tabid ]
627+ local bufnr = self . bufnr_by_tabid [tabid ]
632628
633629 if bufnr then
634630 for _ , winid in pairs (vim .api .nvim_tabpage_list_wins (tabid or 0 )) do
653649function View :get_bufnr ()
654650 local tab = vim .api .nvim_get_current_tabpage ()
655651
656- return globals . BUFNR_BY_TABID [tab ]
652+ return self . bufnr_by_tabid [tab ]
657653end
658654
659655function View :prevent_buffer_override ()
0 commit comments