summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-04-10 14:29:31 +0200
committermo8it <mo8it@proton.me>2024-04-10 14:29:31 +0200
commita59acf88354c8dfba301e59173653bc9a5f4bfb2 (patch)
tree2fb638b88b184c154b18c72179df16363d60d548 /src
parent62e92476e6dad1fc191fd666eae2fccb263f5ff0 (diff)
Show the current exercise path
Diffstat (limited to 'src')
-rw-r--r--src/progress_bar.rs2
-rw-r--r--src/watch/state.rs6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/progress_bar.rs b/src/progress_bar.rs
index 97c8ad9..d6962b8 100644
--- a/src/progress_bar.rs
+++ b/src/progress_bar.rs
@@ -49,7 +49,7 @@ pub fn progress_bar(progress: u16, total: u16, line_width: u16) -> Result<String
write!(line, "{}", red_part.red()).unwrap();
}
- write!(line, "] {progress:>3}/{total} exercises").unwrap();
+ writeln!(line, "] {progress:>3}/{total} exercises").unwrap();
Ok(line)
}
diff --git a/src/watch/state.rs b/src/watch/state.rs
index 751285f..da5ac3d 100644
--- a/src/watch/state.rs
+++ b/src/watch/state.rs
@@ -149,6 +149,12 @@ You can keep working on this exercise or jump into the next one by removing the
let progress_bar = progress_bar(self.progress, self.exercises.len() as u16, line_width)?;
self.writer.write_all(progress_bar.as_bytes())?;
+ self.writer.write_all(b"Current exercise: ")?;
+ self.writer.write_fmt(format_args!(
+ "{}",
+ self.exercise.path.to_string_lossy().bold()
+ ))?;
+
self.show_prompt()?;
Ok(())