diff options
author | Shav Kinderlehrer <[email protected]> | 2024-03-24 14:18:53 -0400 |
---|---|---|
committer | Shav Kinderlehrer <[email protected]> | 2024-03-24 14:18:53 -0400 |
commit | f638f4bd1e3a03bc2bdd5f9dcd57d4830fd3c553 (patch) | |
tree | fa42f60268450070fd8c25596c6bdc046369996b /src/components/global_keys.rs | |
parent | 9d23304feba7b1ed50e582ea5a26deafedba505a (diff) | |
download | molehole-f638f4bd1e3a03bc2bdd5f9dcd57d4830fd3c553.tar.gz molehole-f638f4bd1e3a03bc2bdd5f9dcd57d4830fd3c553.zip |
Diffstat (limited to 'src/components/global_keys.rs')
-rw-r--r-- | src/components/global_keys.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/components/global_keys.rs b/src/components/global_keys.rs index 39ec1b7..dd903b1 100644 --- a/src/components/global_keys.rs +++ b/src/components/global_keys.rs @@ -58,20 +58,17 @@ impl Component for GlobalKeys { self.scroll_state = self.scroll_state.position(self.scroll); } - fn handle_key_event( - &mut self, - key: KeyEvent, - ) -> eyre::Result<Option<AppAction>> { + fn handle_key_event(&mut self, key: KeyEvent) -> Option<AppAction> { if key.kind == KeyEventKind::Press { let key_event = serialize_key_event(key); for key_command in &mut self.key_commands { if key_command.key_code == key_event { - return Ok(Some(key_command.action.clone())); + return Some(key_command.action.clone()); } } } - Ok(None) + None } fn render(&mut self, frame: &mut Frame, rect: Rect) -> eyre::Result<()> { |