Skip to content

Commit a2d1cb3

Browse files
committed
Push newline after running an exercise instead on each rendering
1 parent e7ba88f commit a2d1cb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/watch/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ impl<'a> WatchState<'a> {
5656
"\nChecking the exercise `{}`. Please wait…",
5757
self.app_state.current_exercise().name,
5858
)?;
59+
5960
let success = self
6061
.app_state
6162
.current_exercise()
6263
.run_exercise(Some(&mut self.output), self.app_state.cmd_runner())?;
64+
self.output.push(b'\n');
6365
if success {
6466
self.done_status =
6567
if let Some(solution_path) = self.app_state.current_solution_path()? {
@@ -121,11 +123,9 @@ impl<'a> WatchState<'a> {
121123
pub fn render(&mut self) -> Result<()> {
122124
// Prevent having the first line shifted if clearing wasn't successful.
123125
self.writer.write_all(b"\n")?;
124-
125126
clear_terminal(&mut self.writer)?;
126127

127128
self.writer.write_all(&self.output)?;
128-
self.writer.write_all(b"\n")?;
129129

130130
if self.show_hint {
131131
writeln!(

0 commit comments

Comments
 (0)