Skip to content

Commit f0aaf3b

Browse files
committed
Fill all last text to space and return the cursor
1 parent 27943be commit f0aaf3b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

crates/ra_cli/src/progress_report.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,14 @@ impl ProgressReport {
107107
}
108108

109109
fn clear(&mut self) {
110-
print!("{}{}", " ".repeat(self.text.len()), "\x08".repeat(self.text.len()));
110+
if self.hidden {
111+
return;
112+
}
113+
114+
// Fill all last text to space and return the cursor
115+
let spaces = " ".repeat(self.text.len());
116+
let backspaces = "\x08".repeat(self.text.len());
117+
print!("{}{}{}", backspaces, spaces, backspaces);
111118
self.text = String::new();
112119
}
113120
}

0 commit comments

Comments
 (0)