feat: Improve pane switching by handling mouse press event immediately

This commit is contained in:
n loewen (aider) 2025-06-07 23:09:00 +01:00
parent b0a142e90c
commit d22b9ff5b9
1 changed files with 6 additions and 3 deletions

View File

@ -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