Splits layout: Fix move_window_forward not working

Fixes #7264
This commit is contained in:
Kovid Goyal 2024-03-26 08:21:03 +05:30
parent 1ae607f924
commit cd5099d6f7
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 13 additions and 0 deletions

View file

@ -68,6 +68,8 @@ Detailed list of changes
- Fix handling of tab character when cursor is at end of line and wrapping is enabled (:iss:`7250`)
- Splits layout: Fix :ac:`move_window_forward` not working (:iss:`7264`)
0.33.1 [2024-03-21]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -558,6 +558,17 @@ def neighbors_for_window(self, window: WindowType, all_windows: WindowList) -> N
pair.neighbors_for_window(wg.id, ans, self, all_windows)
return ans
def move_window(self, all_windows: WindowList, delta: int = 1) -> bool:
before = all_windows.active_group
if before is None:
return False
before_idx = all_windows.active_group_idx
moved = super().move_window(all_windows, delta)
after = all_windows.groups[before_idx]
if moved and before.id != after.id:
self.pairs_root.swap_windows(before.id, after.id)
return moved
def move_window_to_group(self, all_windows: WindowList, group: int) -> bool:
before = all_windows.active_group
if before is None: