diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-11-17 21:45:25 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-11-17 21:45:25 -0500 |
commit | 26bb4e54e9669b487817d09ebfa36836293d741d (patch) | |
tree | dfdedab0e497c3e62a900ca0e4ba94380bed67bd /src/readline.rs | |
parent | 35cdb6a27e25504f6eb368d48f1007085883635c (diff) | |
download | nbsh-26bb4e54e9669b487817d09ebfa36836293d741d.tar.gz nbsh-26bb4e54e9669b487817d09ebfa36836293d741d.zip |
make action handling the main task
Diffstat (limited to 'src/readline.rs')
-rw-r--r-- | src/readline.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/readline.rs b/src/readline.rs index 9713a8a..093de3d 100644 --- a/src/readline.rs +++ b/src/readline.rs @@ -22,7 +22,7 @@ impl Readline { } } - pub async fn handle_key(&mut self, key: textmode::Key) -> bool { + pub async fn handle_key(&mut self, key: textmode::Key) { match key { textmode::Key::String(s) => self.add_input(&s), textmode::Key::Char(c) => { @@ -30,7 +30,7 @@ impl Readline { } textmode::Key::Ctrl(b'c') => self.clear_input(), textmode::Key::Ctrl(b'd') => { - return true; + self.action.send(crate::action::Action::Quit).await.unwrap(); } textmode::Key::Ctrl(b'l') => { self.action @@ -55,7 +55,6 @@ impl Readline { .send(crate::action::Action::Render) .await .unwrap(); - false } pub fn lines(&self) -> usize { |