mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 17:46:42 +01:00
factor input handling into modes
This commit is contained in:
parent
648c37e9d4
commit
48f651fc0f
5 changed files with 115 additions and 74 deletions
14
src/keys/quit.rs
Normal file
14
src/keys/quit.rs
Normal 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 })
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue