From 2f7840568cdf302b8498dd15fb07782c4369098f Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Mon, 24 Feb 2020 21:29:01 -0500 Subject: [PATCH 1/2] Fix for issue in powershell. Insure that this is tested on other systems first. At least Linux. --- src/main.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3a576460..f72de300 100644 --- a/src/main.rs +++ b/src/main.rs @@ -325,7 +325,7 @@ fn handle_key_event_or_break( KeyCode::Down => app.on_down_key(), KeyCode::Left => app.on_left_key(), KeyCode::Right => app.on_right_key(), - KeyCode::Char(character) => app.on_char_key(character), + KeyCode::Char(caught_char) => app.on_char_key(caught_char), KeyCode::Esc => app.on_esc(), KeyCode::Enter => app.on_enter(), KeyCode::Tab => app.on_tab(), @@ -361,14 +361,10 @@ fn handle_key_event_or_break( } else if let KeyModifiers::SHIFT = event.modifiers { match event.code { KeyCode::Left => app.move_widget_selection_left(), - KeyCode::Char('h') | KeyCode::Char('H') => app.on_char_key('H'), KeyCode::Right => app.move_widget_selection_right(), - KeyCode::Char('l') | KeyCode::Char('L') => app.on_char_key('L'), KeyCode::Up => app.move_widget_selection_up(), - KeyCode::Char('k') | KeyCode::Char('K') => app.on_char_key('K'), KeyCode::Down => app.move_widget_selection_down(), - KeyCode::Char('j') | KeyCode::Char('J') => app.on_char_key('J'), - KeyCode::Char('/') | KeyCode::Char('?') => app.on_char_key('?'), + KeyCode::Char(caught_char) => app.on_char_key(caught_char), _ => {} } } else if let KeyModifiers::ALT = event.modifiers { From 1c52587760eeb92b01016fbabb0f893607909480 Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Mon, 24 Feb 2020 21:37:36 -0500 Subject: [PATCH 2/2] Fix alt key too... windows treats it as a CAPITAL. Go figure. --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index f72de300..03c3cd5c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -369,21 +369,21 @@ fn handle_key_event_or_break( } } else if let KeyModifiers::ALT = event.modifiers { match event.code { - KeyCode::Char('c') => { + KeyCode::Char('c') | KeyCode::Char('C') => { if app.is_in_search_widget() { app.process_search_state.toggle_ignore_case(); app.update_regex(); app.update_process_gui = true; } } - KeyCode::Char('w') => { + KeyCode::Char('w') | KeyCode::Char('W') => { if app.is_in_search_widget() { app.process_search_state.toggle_search_whole_word(); app.update_regex(); app.update_process_gui = true; } } - KeyCode::Char('r') => { + KeyCode::Char('r') | KeyCode::Char('R') => { if app.is_in_search_widget() { app.process_search_state.toggle_search_regex(); app.update_regex();