Better fix for closing non-active tab
This commit is contained in:
parent
13b900faf7
commit
0d94ca5399
2 changed files with 4 additions and 1 deletions
|
|
@ -551,6 +551,10 @@ def confirm_tab_close(self, tab: Tab) -> None:
|
|||
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)],
|
||||
|
|
|
|||
|
|
@ -999,7 +999,6 @@ def handle_click_on_tab(self, x: int, button: int, modifiers: int, action: int)
|
|||
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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue