From d22b9ff5b9b96b563719698e70ed970dc6e11b89 Mon Sep 17 00:00:00 2001 From: "n loewen (aider)" Date: Sat, 7 Jun 2025 23:09:00 +0100 Subject: [PATCH] feat: Improve pane switching by handling mouse press event immediately --- gtm2.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gtm2.py b/gtm2.py index fc2190f..e080036 100755 --- a/gtm2.py +++ b/gtm2.py @@ -449,13 +449,16 @@ def handle_mouse_input(stdscr, state): if abs(mx - state.divider_col) <= 1: state.dragging_divider = True else: - # Start a new selection + # Switch panes immediately on click + state.focus = "left" if mx < state.divider_col else "right" + + # Also start a potential selection (in case this becomes a drag) state.is_selecting = True state.selection_start_coord = (mx, my) state.selection_end_coord = (mx, my) - # Store the click position for later comparison state.click_position = (mx, my) - # Redraw immediately to show selection highlight + + # Redraw immediately to show selection highlight and focus change draw_ui(stdscr, state) return