factor input handling into modes

This commit is contained in:
🪞👃🪞 2025-04-03 23:29:35 +03:00
parent 648c37e9d4
commit 48f651fc0f
5 changed files with 115 additions and 74 deletions

14
src/keys/quit.rs Normal file
View file

@ -0,0 +1,14 @@
use crate::*;
impl Taggart {
pub fn mode_quit (&mut self, event: &Event) {
todo!()
}
pub fn quit_begin (&mut self, input: &TuiIn) {
if self.tasks.len() == 0 {
input.done()
} else {
self.mode = Some(Mode::Quit { value: false })
}
}
}