summaryrefslogtreecommitdiffstats
path: root/src/readline.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-11-17 21:45:25 -0500
committerJesse Luehrs <doy@tozt.net>2021-11-17 21:45:25 -0500
commit26bb4e54e9669b487817d09ebfa36836293d741d (patch)
treedfdedab0e497c3e62a900ca0e4ba94380bed67bd /src/readline.rs
parent35cdb6a27e25504f6eb368d48f1007085883635c (diff)
downloadnbsh-26bb4e54e9669b487817d09ebfa36836293d741d.tar.gz
nbsh-26bb4e54e9669b487817d09ebfa36836293d741d.zip
make action handling the main task
Diffstat (limited to 'src/readline.rs')
-rw-r--r--src/readline.rs5
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 {