refactor: Simplify keyboard input handling and update main function signature
This commit is contained in:
parent
313acdac8a
commit
b942954620
5
gtm
5
gtm
|
|
@ -1409,9 +1409,6 @@ def handle_keyboard_input(key, state: AppState) -> AppState:
|
|||
elif key in [67, ord('C')]: # ASCII code for 'C' (uppercase)
|
||||
if state.show_additions or state.show_deletions:
|
||||
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')]:
|
||||
if state.show_sidebar:
|
||||
return replace(state, focus="left")
|
||||
|
|
@ -1441,7 +1438,7 @@ def handle_keyboard_input(key, state: AppState) -> AppState:
|
|||
|
||||
# --- 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:
|
||||
curses.curs_set(0)
|
||||
except:
|
||||
|
|
|
|||
Loading…
Reference in New Issue