fix: Prevent multiple mouse drag actions and restore pane switching

This commit is contained in:
n loewen (aider) 2025-06-07 21:34:07 +01:00
parent 66940d44f9
commit f527ba4c36
1 changed files with 8 additions and 6 deletions

14
gtm2.py
View File

@ -378,12 +378,14 @@ def handle_mouse_input(stdscr, state):
_, mx, my, _, bstate = curses.getmouse()
if bstate & curses.BUTTON1_PRESSED:
if abs(mx - state.divider_col) <= 1:
state.dragging_divider = True
else:
state.is_selecting = True
state.selection_start_coord = (mx, my)
state.selection_end_coord = (mx, my)
# Only start a new action if no action is in progress
if not state.dragging_divider and not state.is_selecting:
if abs(mx - state.divider_col) <= 1:
state.dragging_divider = True
else:
state.is_selecting = True
state.selection_start_coord = (mx, my)
state.selection_end_coord = (mx, my)
if state.dragging_divider:
state.update_divider(mx)