summaryrefslogtreecommitdiff
path: root/src/watch
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-08-20 16:05:52 +0200
committermo8it <mo8it@proton.me>2024-08-20 16:05:52 +0200
commita2d1cb3b2246f50ea36408f2be1962f5dc69d09b (patch)
treebafd5aeec83e3b2e918ac47c8d2e95c4e6453e85 /src/watch
parente7ba88f90594962795bd028a8537efd6b1eedf6e (diff)
Push newline after running an exercise instead on each rendering
Diffstat (limited to 'src/watch')
-rw-r--r--src/watch/state.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/watch/state.rs b/src/watch/state.rs
index fe972fa..6bf8e69 100644
--- a/src/watch/state.rs
+++ b/src/watch/state.rs
@@ -56,10 +56,12 @@ impl<'a> WatchState<'a> {
"\nChecking the exercise `{}`. Please wait…",
self.app_state.current_exercise().name,
)?;
+
let success = self
.app_state
.current_exercise()
.run_exercise(Some(&mut self.output), self.app_state.cmd_runner())?;
+ self.output.push(b'\n');
if success {
self.done_status =
if let Some(solution_path) = self.app_state.current_solution_path()? {
@@ -121,11 +123,9 @@ impl<'a> WatchState<'a> {
pub fn render(&mut self) -> Result<()> {
// Prevent having the first line shifted if clearing wasn't successful.
self.writer.write_all(b"\n")?;
-
clear_terminal(&mut self.writer)?;
self.writer.write_all(&self.output)?;
- self.writer.write_all(b"\n")?;
if self.show_hint {
writeln!(