parent
d360d077d1
commit
b063c8cda1
@ -91,6 +91,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
|||||||
- Graphics protocol: Fix suppression of responses not working for chunked
|
- Graphics protocol: Fix suppression of responses not working for chunked
|
||||||
transmission (:iss:`3375`)
|
transmission (:iss:`3375`)
|
||||||
|
|
||||||
|
- Fix inactive tab closing causing active tab to change (:iss:`3398`)
|
||||||
|
|
||||||
|
|
||||||
0.19.3 [2020-12-19]
|
0.19.3 [2020-12-19]
|
||||||
-------------------
|
-------------------
|
||||||
|
|||||||
@ -745,29 +745,31 @@ class TabManager: # {{{
|
|||||||
|
|
||||||
def remove(self, tab: Tab) -> None:
|
def remove(self, tab: Tab) -> None:
|
||||||
self._remove_tab(tab)
|
self._remove_tab(tab)
|
||||||
next_active_tab = -1
|
active_tab_needs_to_change = self.active_tab is None or self.active_tab is tab
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
self.active_tab_history.remove(tab.id)
|
self.active_tab_history.remove(tab.id)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
break
|
break
|
||||||
|
|
||||||
if self.opts.tab_switch_strategy == 'previous':
|
if active_tab_needs_to_change:
|
||||||
while self.active_tab_history and next_active_tab < 0:
|
next_active_tab = -1
|
||||||
tab_id = self.active_tab_history.pop()
|
if self.opts.tab_switch_strategy == 'previous':
|
||||||
for idx, qtab in enumerate(self.tabs):
|
while self.active_tab_history and next_active_tab < 0:
|
||||||
if qtab.id == tab_id:
|
tab_id = self.active_tab_history.pop()
|
||||||
next_active_tab = idx
|
for idx, qtab in enumerate(self.tabs):
|
||||||
break
|
if qtab.id == tab_id:
|
||||||
elif self.opts.tab_switch_strategy == 'left':
|
next_active_tab = idx
|
||||||
next_active_tab = max(0, self.active_tab_idx - 1)
|
break
|
||||||
elif self.opts.tab_switch_strategy == 'right':
|
elif self.opts.tab_switch_strategy == 'left':
|
||||||
next_active_tab = min(self.active_tab_idx, len(self.tabs) - 1)
|
next_active_tab = max(0, self.active_tab_idx - 1)
|
||||||
|
elif self.opts.tab_switch_strategy == 'right':
|
||||||
|
next_active_tab = min(self.active_tab_idx, len(self.tabs) - 1)
|
||||||
|
|
||||||
if next_active_tab < 0:
|
if next_active_tab < 0:
|
||||||
next_active_tab = max(0, min(self.active_tab_idx, len(self.tabs) - 1))
|
next_active_tab = max(0, min(self.active_tab_idx, len(self.tabs) - 1))
|
||||||
|
|
||||||
self._set_active_tab(next_active_tab)
|
self._set_active_tab(next_active_tab)
|
||||||
self.mark_tab_bar_dirty()
|
self.mark_tab_bar_dirty()
|
||||||
tab.destroy()
|
tab.destroy()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user