Skip to content

Commit

Permalink
Only handle file changes for the current exercise, no jumping back
Browse files Browse the repository at this point in the history
  • Loading branch information
mo8it committed Sep 17, 2024
1 parent 89c40ba commit 4e4b657
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/watch/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 4e4b657

Please sign in to comment.