From a73213a88b3a152255d43b4fd9b88286be25976e Mon Sep 17 00:00:00 2001 From: "n loewen (aider)" Date: Sat, 7 Jun 2025 23:45:58 +0100 Subject: [PATCH] feat: Add ability to select commits by clicking in the sidebar --- gtm2.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtm2.py b/gtm2.py index a7252fe..4357737 100755 --- a/gtm2.py +++ b/gtm2.py @@ -536,6 +536,13 @@ def handle_mouse_input(stdscr, state): abs(state.click_position[1] - my) <= 2): # This was a click, so switch panes state.focus = "left" if mx < state.divider_col else "right" + + # If clicking in the left pane on a commit entry, select that commit + if mx < state.divider_col and my < len(state.commits) - state.left_scroll_offset: + new_commit_idx = my + state.left_scroll_offset + if 0 <= new_commit_idx < len(state.commits): + state.selected_commit_idx = new_commit_idx + state.load_commit_content() elif state.selection_start_coord and state.selection_end_coord: # This was a drag selection, copy the text copy_selection_to_clipboard(stdscr, state)