summaryrefslogtreecommitdiff
path: root/src/watch/state.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-09-18 01:44:13 +0200
committermo8it <mo8it@proton.me>2024-09-18 01:44:13 +0200
commit4e4b65711a20ae3d02baa79d8295da2b30ec7dd2 (patch)
treeb4c8bcf9929698c1dfa809b5d76d57ff7595a7b5 /src/watch/state.rs
parent89c40ba25672b2da17e2fcc5bc742462699d54dd (diff)
Only handle file changes for the current exercise, no jumping back
Diffstat (limited to 'src/watch/state.rs')
-rw-r--r--src/watch/state.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/watch/state.rs b/src/watch/state.rs
index 8cccb40..cb79b35 100644
--- a/src/watch/state.rs
+++ b/src/watch/state.rs
@@ -100,14 +100,10 @@ impl<'a> WatchState<'a> {
exercise_ind: usize,
stdout: &mut StdoutLock,
) -> Result<()> {
- // Don't skip exercises on file changes to avoid confusion from missing exercises.
- // Skipping exercises must be explicit in the interactive list.
- // But going back to an earlier exercise on file change is fine.
- if self.app_state.current_exercise_ind() < exercise_ind {
+ if self.app_state.current_exercise_ind() != exercise_ind {
return Ok(());
}
- self.app_state.set_current_exercise_ind(exercise_ind)?;
self.run_current_exercise(stdout)
}