diff --git a/src/watch/state.rs b/src/watch/state.rs index 46f48d9fab..66aff0a797 100644 --- a/src/watch/state.rs +++ b/src/watch/state.rs @@ -27,6 +27,7 @@ pub struct WatchState<'a> { show_hint: bool, done_status: DoneStatus, manual_run: bool, + pending: bool, } impl<'a> WatchState<'a> { @@ -40,6 +41,7 @@ impl<'a> WatchState<'a> { show_hint: false, done_status: DoneStatus::Pending, manual_run, + pending: false, } } @@ -51,6 +53,10 @@ impl<'a> WatchState<'a> { pub fn run_current_exercise(&mut self) -> Result<()> { self.show_hint = false; + self.pending = true; + self.render()?; + self.pending = false; // remove pending UI on next render + let success = self .app_state .current_exercise() @@ -164,6 +170,13 @@ When you are done experimenting, enter `n` to move on to the next exercise 🦀" self.show_prompt()?; + // TODO remove the whole pending logic once this is fixed: + // https://github.com/rust-lang/rustlings/issues/2071 + if self.pending { + self.writer + .write_all(b"\n\nChecking the exercises...\n\nThank you for your patience...\n")?; + } + Ok(()) }