From cd5099d6f7373e02122269f2a557a5a468b18332 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 26 Mar 2024 08:21:03 +0530 Subject: [PATCH] Splits layout: Fix move_window_forward not working Fixes #7264 --- docs/changelog.rst | 2 ++ kitty/layout/splits.py | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index de4d385d4..6d7644559 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/layout/splits.py b/kitty/layout/splits.py index 2db75a679..8ae86c8e2 100644 --- a/kitty/layout/splits.py +++ b/kitty/layout/splits.py @@ -558,6 +558,17 @@ class Splits(Layout): 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: