summaryrefslogtreecommitdiffstats
path: root/src/action.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/action.rs
parent35cdb6a27e25504f6eb368d48f1007085883635c (diff)
downloadnbsh-26bb4e54e9669b487817d09ebfa36836293d741d.tar.gz
nbsh-26bb4e54e9669b487817d09ebfa36836293d741d.zip
make action handling the main task
Diffstat (limited to 'src/action.rs')
-rw-r--r--src/action.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/action.rs b/src/action.rs
index 2e27393..c7f437c 100644
--- a/src/action.rs
+++ b/src/action.rs
@@ -5,6 +5,7 @@ pub enum Action {
Run(String),
UpdateFocus(crate::state::Focus),
Resize((u16, u16)),
+ Quit,
}
pub struct Debouncer {
@@ -46,7 +47,8 @@ impl Pending {
}
fn has_event(&self) -> bool {
- self.render.is_some()
+ self.done
+ || self.render.is_some()
|| self.force_redraw.is_some()
|| !self.run.is_empty()
|| self.focus.is_some()
@@ -85,7 +87,7 @@ impl Pending {
Some(Action::Run(cmd)) => self.run.push_back(cmd.to_string()),
Some(Action::UpdateFocus(focus)) => self.focus = Some(*focus),
Some(Action::Resize(size)) => self.size = Some(*size),
- None => self.done = true,
+ Some(Action::Quit) | None => self.done = true,
}
}
}