From 6c44fcea822c58b6305986975ef480f4783090f7 Mon Sep 17 00:00:00 2001 From: "n loewen (aider)" Date: Sun, 8 Jun 2025 02:42:28 +0100 Subject: [PATCH] feat: Add keyboard shortcuts for toggling diff modes with 'd', 'a', and 'x' --- gtm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gtm b/gtm index 2331bb4..f8059f2 100755 --- a/gtm +++ b/gtm @@ -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'):