From eff2ce8a23bcd8f979dff917bcdb83dccbaa4170 Mon Sep 17 00:00:00 2001 From: mo8it Date: Mon, 11 Nov 2024 14:55:58 +0100 Subject: [PATCH] Ignore input while checking all exercises in watch mode --- src/watch/state.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/watch/state.rs b/src/watch/state.rs index c27dedf..5263bc5 100644 --- a/src/watch/state.rs +++ b/src/watch/state.rs @@ -269,6 +269,9 @@ impl<'a> WatchState<'a> { } pub fn check_all_exercises(&mut self, stdout: &mut StdoutLock) -> Result { + // Ignore any input until checking all exercises is done. + let _input_pause_guard = InputPauseGuard::scoped_pause(); + if let Some(first_pending_exercise_ind) = self.app_state.check_all_exercises(stdout)? { // Only change exercise if the current one is done. if self.app_state.current_exercise().done {