refactor: Simplify keyboard input handling and update main function signature

This commit is contained in:
n loewen 2025-06-08 10:13:14 +01:00 committed by n loewen (aider)
parent 313acdac8a
commit b942954620
1 changed files with 1 additions and 4 deletions

5
gtm
View File

@ -1409,9 +1409,6 @@ def handle_keyboard_input(key, state: AppState) -> AppState:
elif key in [67, ord('C')]: # ASCII code for 'C' (uppercase) elif key in [67, ord('C')]: # ASCII code for 'C' (uppercase)
if state.show_additions or state.show_deletions: if state.show_additions or state.show_deletions:
return jump_to_prev_change(state) return jump_to_prev_change(state)
elif key in [112, ord('p')]: # ASCII code for 'p'
if state.show_additions or state.show_deletions:
return jump_to_prev_change(state)
elif key in [curses.KEY_LEFT, ord('h')]: elif key in [curses.KEY_LEFT, ord('h')]:
if state.show_sidebar: if state.show_sidebar:
return replace(state, focus="left") return replace(state, focus="left")
@ -1441,7 +1438,7 @@ def handle_keyboard_input(key, state: AppState) -> AppState:
# --- Main Application --- # --- Main Application ---
def main(stdscr, filename, show_diff, show_add, show_del, mouse, wrap_lines=True, show_line_numbers=False): def main(stdscr, filename, show_add, show_del, mouse, show_diff=True, wrap_lines=True, show_line_numbers=True):
try: try:
curses.curs_set(0) curses.curs_set(0)
except: except: