summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClementTsang <cjhtsang@uwaterloo.ca>2020-02-15 18:06:17 -0500
committerClementTsang <cjhtsang@uwaterloo.ca>2020-02-15 18:06:17 -0500
commit0c48c5973f62de096dcd042d28ec2a9c62ef9b21 (patch)
tree6ac3ad570a520a8a43225953fa93308847447469 /src
parent59c0b3df62490c17d25d04dd0be3cb55593bc93c (diff)
More refactoring of some code to make it cleaner.
Diffstat (limited to 'src')
-rw-r--r--src/main.rs20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/main.rs b/src/main.rs
index 4c944be7..44cb2d5a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -342,18 +342,14 @@ fn handle_key_event_or_break(
}
} else if let KeyModifiers::SHIFT = event.modifiers {
match event.code {
- KeyCode::Left | KeyCode::Char('h') | KeyCode::Char('H') => {
- app.move_widget_selection_left()
- }
- KeyCode::Right | KeyCode::Char('l') | KeyCode::Char('L') => {
- app.move_widget_selection_right()
- }
- KeyCode::Up | KeyCode::Char('k') | KeyCode::Char('K') => {
- app.move_widget_selection_up()
- }
- KeyCode::Down | KeyCode::Char('j') | KeyCode::Char('J') => {
- app.move_widget_selection_down()
- }
+ 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('?'),
_ => {}
}