summaryrefslogtreecommitdiff
path: root/src/watch/state.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-05-13 02:32:25 +0200
committermo8it <mo8it@proton.me>2024-05-13 02:32:25 +0200
commitf9e35a4344cd7d51923f1983cf824fb36be92d50 (patch)
tree6a41653c14dcce73c398ebfec3051102d2c2566a /src/watch/state.rs
parent052573904604896398a6cc7281398fa9fdf8f083 (diff)
Improve input handling
Diffstat (limited to 'src/watch/state.rs')
-rw-r--r--src/watch/state.rs13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/watch/state.rs b/src/watch/state.rs
index f3ffac8..2e98546 100644
--- a/src/watch/state.rs
+++ b/src/watch/state.rs
@@ -78,10 +78,7 @@ impl<'a> WatchState<'a> {
pub fn next_exercise(&mut self) -> Result<ExercisesProgress> {
if matches!(self.done_status, DoneStatus::Pending) {
- self.writer
- .write_all(b"The current exercise isn't done yet\n")?;
- self.show_prompt()?;
- return Ok(ExercisesProgress::Pending);
+ return Ok(ExercisesProgress::CurrentPending);
}
self.app_state.done_current_exercise(&mut self.writer)
@@ -165,12 +162,4 @@ When you are done experimenting, enter `n` (or `next`) to move on to the next ex
self.show_hint = true;
self.render()
}
-
- pub fn handle_invalid_input(&mut self, input: char) -> io::Result<()> {
- writeln!(
- self.writer,
- "Invalid input: {input} (confusing input can occur after resizing the terminal)",
- )?;
- self.show_prompt()
- }
}