Better fix for closing non-active tab

This commit is contained in:
Kovid Goyal 2021-10-25 08:11:50 +05:30
parent 13b900faf7
commit 0d94ca5399
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 1 deletions

View File

@ -551,6 +551,10 @@ class Boss:
if not needs_confirmation:
self.close_tab_no_confirm(tab)
return
if tab is not self.active_tab:
tm = tab.tab_manager_ref()
if tm is not None:
tm.set_active_tab(tab)
self._run_kitten('ask', ['--type=yesno', '--message', _(
'Are you sure you want to close this tab, it has {}'
' windows running?').format(num)],

View File

@ -999,7 +999,6 @@ class TabManager: # {{{
self.set_active_tab_idx(i)
elif button == GLFW_MOUSE_BUTTON_MIDDLE:
tab = self.tabs[i]
self.set_active_tab(tab)
get_boss().close_tab(tab)
self.recent_mouse_events.append(TabMouseEvent(button, modifiers, action, now, i))
if len(self.recent_mouse_events) > 5: