From c3a111fbd2acf3c956c58b92a11c3cfeb08d556a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 31 Mar 2026 16:28:19 +0000 Subject: [PATCH] Fix inverted border drag direction in splits layout Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/10200944-3143-4347-880c-f4d5b96749f5 Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com> --- docs/changelog.rst | 2 ++ kitty/layout/splits.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 6c0514c7a..fd6c4e0fa 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -211,6 +211,8 @@ Detailed list of changes - macOS: Add Copy and Paste menu items to the Edit menu in the global menu bar (:iss:`9780`) +- Fix dragging of splits layout borders sometimes moving in the wrong direction (:pull:`9447`) + 0.46.2 [2026-03-21] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/layout/splits.py b/kitty/layout/splits.py index 3e8283f1b..b3b636455 100644 --- a/kitty/layout/splits.py +++ b/kitty/layout/splits.py @@ -498,9 +498,9 @@ class Pair: return False if self.two == gid: return True - if not isinstance(self.two, Pair): - return False - return self.two.is_group_on_second(gid) + if isinstance(self.two, Pair): + return self.two.pair_for_window(gid) is not None + return False def find_window_in_tree(self, window_id: int) -> 'list[tuple[Pair, bool]] | None': # Returns list of (pair, is_in_one) from self down to the pair containing window_id.