Remove check all input

This commit is contained in:
mo8it 2026-08-02 14:16:12 +02:00 committed by Mo Bitar
parent 283a508ad9
commit 9d6388387f
3 changed files with 6 additions and 10 deletions

View File

@ -43,6 +43,7 @@ enum WatchEvent {
Input(InputEvent),
FileChange { exercise_ind: usize },
TerminalResize { width: u16 },
CheckAll,
NotifyErr(notify::Error),
TerminalEventErr(io::Error),
}
@ -102,13 +103,6 @@ fn run_watch(
WatchEvent::Input(InputEvent::Run) => watch_state.run_current_exercise(&mut stdout)?,
WatchEvent::Input(InputEvent::Hint) => watch_state.show_hint(&mut stdout)?,
WatchEvent::Input(InputEvent::List) => return Ok(WatchExit::List),
WatchEvent::Input(InputEvent::CheckAll) => match watch_state
.check_all_exercises(&mut stdout)?
{
ExercisesProgress::AllDone => break,
ExercisesProgress::NewPending => watch_state.run_current_exercise(&mut stdout)?,
ExercisesProgress::CurrentPending => watch_state.render(&mut stdout)?,
},
WatchEvent::Input(InputEvent::Reset) => watch_state.reset_exercise(&mut stdout)?,
WatchEvent::Input(InputEvent::Quit) => {
stdout.write_all(QUIT_MSG)?;
@ -120,6 +114,11 @@ fn run_watch(
WatchEvent::TerminalResize { width } => {
watch_state.update_term_width(width, &mut stdout)?;
}
WatchEvent::CheckAll => match watch_state.check_all_exercises(&mut stdout)? {
ExercisesProgress::AllDone => break,
ExercisesProgress::NewPending => watch_state.run_current_exercise(&mut stdout)?,
ExercisesProgress::CurrentPending => watch_state.render(&mut stdout)?,
},
WatchEvent::NotifyErr(e) => return Err(Error::from(e).context(NOTIFY_ERR)),
WatchEvent::TerminalEventErr(e) => {
return Err(Error::from(e).context("Terminal event listener failed"));

View File

@ -202,7 +202,6 @@ impl<'a> WatchState<'a> {
}
show_key(b'l', b":list / ")?;
show_key(b'c', b":check all / ")?;
show_key(b'x', b":reset / ")?;
show_key(b'q', b":quit ? ")?;

View File

@ -11,7 +11,6 @@ pub enum InputEvent {
Run,
Hint,
List,
CheckAll,
Reset,
Quit,
}
@ -38,7 +37,6 @@ pub fn terminal_event_handler(
KeyCode::Char('r') if manual_run => InputEvent::Run,
KeyCode::Char('h') => InputEvent::Hint,
KeyCode::Char('l') => break WatchEvent::Input(InputEvent::List),
KeyCode::Char('c') => InputEvent::CheckAll,
KeyCode::Char('x') => {
if sender.send(WatchEvent::Input(InputEvent::Reset)).is_err() {
return;