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