Skip to content

Commit 4e4b657

Browse files
committed
Only handle file changes for the current exercise, no jumping back
1 parent 89c40ba commit 4e4b657

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/watch/state.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,10 @@ impl<'a> WatchState<'a> {
100100
exercise_ind: usize,
101101
stdout: &mut StdoutLock,
102102
) -> Result<()> {
103-
// Don't skip exercises on file changes to avoid confusion from missing exercises.
104-
// Skipping exercises must be explicit in the interactive list.
105-
// But going back to an earlier exercise on file change is fine.
106-
if self.app_state.current_exercise_ind() < exercise_ind {
103+
if self.app_state.current_exercise_ind() != exercise_ind {
107104
return Ok(());
108105
}
109106

110-
self.app_state.set_current_exercise_ind(exercise_ind)?;
111107
self.run_current_exercise(stdout)
112108
}
113109

0 commit comments

Comments
 (0)