File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -56,25 +56,15 @@ pub fn handle_key_event_or_break(
5656 // c_debug!("KeyEvent: {event:?}");
5757
5858 if event. modifiers . is_empty ( ) {
59- // Required catch for searching - otherwise you couldn't search with q.
60- if event. code == KeyCode :: Char ( 'q' ) && !app. is_in_search_widget ( ) {
61- return true ;
62- }
63-
64- // Handle spacebar.
65- // Without the search check, you couldn’t search for names with spaces.
66- if event. code == KeyCode :: Char ( ' ' ) && !app. is_in_search_widget ( ) {
67- app. toggle_tree_mode ( ) ;
68- return false ;
69- }
70-
7159 match event. code {
60+ KeyCode :: Char ( 'q' ) if !app. is_in_search_widget ( ) => return true ,
7261 KeyCode :: End => app. skip_to_last ( ) ,
7362 KeyCode :: Home => app. skip_to_first ( ) ,
7463 KeyCode :: Up => app. on_up_key ( ) ,
7564 KeyCode :: Down => app. on_down_key ( ) ,
7665 KeyCode :: Left => app. on_left_key ( ) ,
7766 KeyCode :: Right => app. on_right_key ( ) ,
67+ KeyCode :: Char ( ' ' ) if !app. is_in_search_widget ( ) => app. toggle_tree_mode ( ) ,
7868 KeyCode :: Char ( caught_char) => app. on_char_key ( caught_char) ,
7969 KeyCode :: Esc => app. on_esc ( ) ,
8070 KeyCode :: Enter => app. on_enter ( ) ,
You can’t perform that action at this time.
0 commit comments