mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-26 19:01:27 +00:00
Fix tab bar not being redrawn when tab is moved out and then brought back in prev position
This commit is contained in:
parent
cad8f3fd17
commit
aaa9ff51b5
1 changed files with 4 additions and 2 deletions
|
|
@ -1571,6 +1571,7 @@ class TabManager: # {{{
|
|||
self.layout_tab_bar()
|
||||
return
|
||||
all_tabs = [t.tab_id for t in self.tab_bar.last_laid_out_tabs]
|
||||
force_update = False
|
||||
if self.tab_being_dropped is None:
|
||||
tab = get_boss().tab_for_id(tab_id)
|
||||
if tab is None:
|
||||
|
|
@ -1581,7 +1582,8 @@ class TabManager: # {{{
|
|||
_, _, start_x, _ = get_tab_being_dragged()
|
||||
self.tab_being_dropped = TabBeingDropped(data=tab_data, tab_ids=all_tabs, last_drop_move_x=int(start_x))
|
||||
mouse_moved_left = False
|
||||
if x == self.tab_being_dropped.last_drop_move_x:
|
||||
force_update = True
|
||||
if x == self.tab_being_dropped.last_drop_move_x and not force_update:
|
||||
return
|
||||
mouse_moved_left = x < self.tab_being_dropped.last_drop_move_x
|
||||
old_tab_ids = self.tab_being_dropped.tab_ids
|
||||
|
|
@ -1598,7 +1600,7 @@ class TabManager: # {{{
|
|||
new_tab_ids = list(old_tab_ids)
|
||||
new_tab_ids[idx_under_mouse], new_tab_ids[old_idx_under_mouse] = new_tab_ids[old_idx_under_mouse], new_tab_ids[idx_under_mouse]
|
||||
self.tab_being_dropped = self.tab_being_dropped._replace(last_drop_move_x=x, tab_ids=new_tab_ids)
|
||||
if self.tab_being_dropped.tab_ids != old_tab_ids:
|
||||
if force_update or self.tab_being_dropped.tab_ids != old_tab_ids:
|
||||
self.layout_tab_bar()
|
||||
|
||||
def on_tab_drop(self, x: int, y: int) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue