diff --git a/gtm2.py b/gtm2.py index bdae00a..d636314 100755 --- a/gtm2.py +++ b/gtm2.py @@ -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)