feat: Add keyboard shortcuts for toggling diff modes with 'd', 'a', and 'x'

This commit is contained in:
n loewen (aider) 2025-06-08 02:42:28 +01:00
parent 4e10b79b8e
commit 6c44fcea82
1 changed files with 9 additions and 0 deletions

9
gtm
View File

@ -717,6 +717,9 @@ def draw_help_popup(stdscr, state):
("N", "Previous search match"),
("c", "Next change"),
("C", "Previous change"),
("d", "Toggle diff mode"),
("a", "Toggle diff additions"),
("x", "Toggle diff deletions"),
("s", "Toggle sidebar"),
("w", "Toggle line wrapping"),
("L", "Toggle line numbers"),
@ -1114,6 +1117,12 @@ def handle_keyboard_input(key, state: AppState) -> AppState:
return replace(state, search_mode=True, search_query="")
elif key == ord('s'):
return toggle_sidebar(state)
elif key == ord('d'):
return replace(state, show_whole_diff=not state.show_whole_diff)
elif key == ord('a'):
return replace(state, show_additions=not state.show_additions)
elif key == ord('x'):
return replace(state, show_deletions=not state.show_deletions)
elif key == ord('w'):
return replace(state, wrap_lines=not state.wrap_lines)
elif key == ord('L'):