@@ -171,8 +171,21 @@ local move_tbl = {
171
171
-- setup_tabpage sets up the initial state of a tab
172
172
--- @private
173
173
--- @param tabpage integer
174
- function View :setup_tabpage (tabpage )
174
+ --- @param callsite string ?
175
+ function View :setup_tabpage (tabpage , callsite )
175
176
local winnr = vim .api .nvim_get_current_win ()
177
+
178
+ local msg = nil
179
+ if self .explorer .opts .experimental .multi_instance_debug then
180
+ msg = string.format ( " View:setup_tabpage(%3s, %-20.20s) w%d" , tabpage , callsite , winnr )
181
+ if globals .TABPAGES [tabpage ] then
182
+ msg = string.format (" %s %s" , msg , vim .inspect (globals .TABPAGES [tabpage ], { newline = " " }))
183
+ else
184
+ msg = string.format (" %s tabinitial" , msg )
185
+ end
186
+ log .line (" dev" , " %s" , msg )
187
+ end
188
+
176
189
globals .TABPAGES [tabpage ] = vim .tbl_extend (" force" , globals .TABPAGES [tabpage ] or tabinitial , { winnr = winnr })
177
190
end
178
191
@@ -221,7 +234,7 @@ function View:open_window()
221
234
vim .api .nvim_command (" vsp" )
222
235
self :reposition_window ()
223
236
end
224
- self :setup_tabpage (vim .api .nvim_get_current_tabpage ())
237
+ self :setup_tabpage (vim .api .nvim_get_current_tabpage (), " View:open_window " )
225
238
self :set_window_options_and_buffer ()
226
239
end
227
240
@@ -448,7 +461,7 @@ function View:open_in_win(opts)
448
461
vim .api .nvim_set_current_win (opts .winid )
449
462
end
450
463
self :create_buffer (opts .hijack_current_buf and vim .api .nvim_get_current_buf ())
451
- self :setup_tabpage (vim .api .nvim_get_current_tabpage ())
464
+ self :setup_tabpage (vim .api .nvim_get_current_tabpage (), " View:open_in_win " )
452
465
self :set_current_win ()
453
466
self :set_window_options_and_buffer ()
454
467
if opts .resize then
0 commit comments