mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 19:21:38 +02:00
Better fix for closing non-active tab
This commit is contained in:
@@ -551,6 +551,10 @@ class Boss:
|
|||||||
if not needs_confirmation:
|
if not needs_confirmation:
|
||||||
self.close_tab_no_confirm(tab)
|
self.close_tab_no_confirm(tab)
|
||||||
return
|
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', _(
|
self._run_kitten('ask', ['--type=yesno', '--message', _(
|
||||||
'Are you sure you want to close this tab, it has {}'
|
'Are you sure you want to close this tab, it has {}'
|
||||||
' windows running?').format(num)],
|
' windows running?').format(num)],
|
||||||
|
|||||||
@@ -999,7 +999,6 @@ class TabManager: # {{{
|
|||||||
self.set_active_tab_idx(i)
|
self.set_active_tab_idx(i)
|
||||||
elif button == GLFW_MOUSE_BUTTON_MIDDLE:
|
elif button == GLFW_MOUSE_BUTTON_MIDDLE:
|
||||||
tab = self.tabs[i]
|
tab = self.tabs[i]
|
||||||
self.set_active_tab(tab)
|
|
||||||
get_boss().close_tab(tab)
|
get_boss().close_tab(tab)
|
||||||
self.recent_mouse_events.append(TabMouseEvent(button, modifiers, action, now, i))
|
self.recent_mouse_events.append(TabMouseEvent(button, modifiers, action, now, i))
|
||||||
if len(self.recent_mouse_events) > 5:
|
if len(self.recent_mouse_events) > 5:
|
||||||
|
|||||||
Reference in New Issue
Block a user