diff options
| author | mo8it <mo8it@proton.me> | 2024-05-13 17:06:11 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-05-13 17:06:11 +0200 |
| commit | 4ae3fcc3caf91d4b22680ed4497c8ee05296eaad (patch) | |
| tree | 1248409373c7943a7b3c663eeead4af76a8d51c4 /src/app_state.rs | |
| parent | 17a2d42ffd868e2049c91d7d1adbecd7f9958020 (diff) | |
Don't skip exercises on file changes
Diffstat (limited to 'src/app_state.rs')
| -rw-r--r-- | src/app_state.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/app_state.rs b/src/app_state.rs index 85639e5..75014ce 100644 --- a/src/app_state.rs +++ b/src/app_state.rs @@ -198,6 +198,10 @@ impl AppState { } pub fn set_current_exercise_ind(&mut self, exercise_ind: usize) -> Result<()> { + if exercise_ind == self.current_exercise_ind { + return Ok(()); + } + if exercise_ind >= self.exercises.len() { bail!(BAD_INDEX_ERR); } |
