feat: Modify Escape key behavior to clear search results instead of exiting
This commit is contained in:
parent
b942954620
commit
b25bf2d16a
4
gtm
4
gtm
|
|
@ -1347,8 +1347,8 @@ def handle_keyboard_input(key, state: AppState) -> AppState:
|
||||||
return replace(state, show_help=False)
|
return replace(state, show_help=False)
|
||||||
elif state.is_selecting:
|
elif state.is_selecting:
|
||||||
return replace(state, is_selecting=False, selection_start_coord=None, selection_end_coord=None)
|
return replace(state, is_selecting=False, selection_start_coord=None, selection_end_coord=None)
|
||||||
else:
|
elif state.search_matches: # Clear active search results
|
||||||
return replace(state, should_exit=True)
|
return replace(state, search_matches=[], current_match_idx=-1)
|
||||||
elif key == ord('?'): # Toggle help popup
|
elif key == ord('?'): # Toggle help popup
|
||||||
return replace(state, show_help=not state.show_help)
|
return replace(state, show_help=not state.show_help)
|
||||||
elif key == ord('/'): # Start search
|
elif key == ord('/'): # Start search
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue