mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-20 15:35:03 +02:00
Fix using the `new_tab !neighbor` action changing the order of the non-neighboring tabs
Fixes #1256
This commit is contained in:
@@ -522,8 +522,9 @@ class TabManager: # {{{
|
||||
self._add_tab(Tab(self, special_window=special_window, cwd_from=cwd_from))
|
||||
self._set_active_tab(idx)
|
||||
if len(self.tabs) > 2 and as_neighbor and idx != nidx:
|
||||
self.tabs[idx], self.tabs[nidx] = self.tabs[nidx], self.tabs[idx]
|
||||
swap_tabs(self.os_window_id, idx, nidx)
|
||||
for i in range(idx, nidx, -1):
|
||||
self.tabs[i], self.tabs[i-1] = self.tabs[i-1], self.tabs[i]
|
||||
swap_tabs(self.os_window_id, i, i-1)
|
||||
self._set_active_tab(nidx)
|
||||
idx = nidx
|
||||
self.mark_tab_bar_dirty()
|
||||
|
||||
Reference in New Issue
Block a user