feat: Add ability to select commits by clicking in the sidebar

This commit is contained in:
n loewen (aider) 2025-06-07 23:45:58 +01:00
parent 87da94851a
commit a73213a88b
1 changed files with 7 additions and 0 deletions

View File

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