@@ -131,16 +131,7 @@ function View:create_buffer(bufnr)
131
131
globals .BUFNR_PER_TAB [tab ] = bufnr or vim .api .nvim_create_buf (false , false )
132
132
133
133
if self .explorer .opts .experimental .multi_instance then
134
- local tabid = tab
135
- self .bufnr_by_tab [tabid ] = globals .BUFNR_PER_TAB [tabid ]
136
-
137
- log .line (" dev" , " buffer channel attaching t%d b%d" , tabid , self .bufnr_by_tab [tabid ])
138
- vim .api .nvim_buf_attach (self .bufnr_by_tab [tabid ], false , {
139
- on_detach = function (op , bnr )
140
- log .line (" dev" , " buffer channel %s t%d b%d" , op , tabid , bnr )
141
- self .bufnr_by_tab [tabid ] = nil
142
- end ,
143
- })
134
+ self .bufnr_by_tab [tab ] = globals .BUFNR_PER_TAB [tab ]
144
135
end
145
136
146
137
vim .api .nvim_buf_set_name (self :get_bufnr (" View:create_buffer1" ), " NvimTree_" .. tab )
@@ -508,18 +499,18 @@ function View:open_in_win(opts)
508
499
events ._dispatch_on_tree_open ()
509
500
end
510
501
511
- --- @param callsite string
512
- function View :abandon_current_window (callsite )
502
+ function View :abandon_current_window ()
513
503
local tab = vim .api .nvim_get_current_tabpage ()
514
504
515
505
if self .explorer .opts .experimental .multi_instance then
516
- log .line (" dev" , " View:abandon_current_window(%-20.20s) t%d w%s b%s member b%s %s" ,
517
- callsite ,
506
+ log .line (" dev" , " View:abandon_current_window() t%d w%s b%s member b%s %s" ,
518
507
tab ,
519
508
globals .TABPAGES [tab ] and globals .TABPAGES [tab ].winnr or nil ,
520
509
globals .BUFNR_PER_TAB [tab ],
521
510
self .bufnr_by_tab [tab ],
522
511
(globals .BUFNR_PER_TAB [tab ] == self .bufnr_by_tab [tab ]) and " " or " MISMATCH" )
512
+
513
+ self .bufnr_by_tab [tab ] = nil
523
514
end
524
515
525
516
-- TODO multi-instance kill the buffer instead of retaining
0 commit comments