feat: Modify 'x' and 'a' keys to toggle off deletions/additions in diff mode
This commit is contained in:
parent
9687b93326
commit
9eaf186cc9
14
gtm
14
gtm
|
|
@ -1120,9 +1120,19 @@ def handle_keyboard_input(key, state: AppState) -> AppState:
|
||||||
elif key == ord('d'):
|
elif key == ord('d'):
|
||||||
return replace(state, show_whole_diff=not state.show_whole_diff)
|
return replace(state, show_whole_diff=not state.show_whole_diff)
|
||||||
elif key == ord('a'):
|
elif key == ord('a'):
|
||||||
return replace(state, show_additions=not state.show_additions)
|
# If diff mode is on, pressing 'a' should toggle off additions
|
||||||
|
# If diff mode is off, pressing 'a' should toggle on additions
|
||||||
|
if state.show_whole_diff:
|
||||||
|
return replace(state, show_additions=False, show_whole_diff=False)
|
||||||
|
else:
|
||||||
|
return replace(state, show_additions=not state.show_additions)
|
||||||
elif key == ord('x'):
|
elif key == ord('x'):
|
||||||
return replace(state, show_deletions=not state.show_deletions)
|
# If diff mode is on, pressing 'x' should toggle off deletions
|
||||||
|
# If diff mode is off, pressing 'x' should toggle on deletions
|
||||||
|
if state.show_whole_diff:
|
||||||
|
return replace(state, show_deletions=False, show_whole_diff=False)
|
||||||
|
else:
|
||||||
|
return replace(state, show_deletions=not state.show_deletions)
|
||||||
elif key == ord('w'):
|
elif key == ord('w'):
|
||||||
return replace(state, wrap_lines=not state.wrap_lines)
|
return replace(state, wrap_lines=not state.wrap_lines)
|
||||||
elif key == ord('L'):
|
elif key == ord('L'):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue