aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_cli/src/progress_report.rs
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2019-11-26 21:01:13 +0000
committerEdwin Cheng <[email protected]>2019-11-26 21:01:13 +0000
commitf0aaf3b2964a26a08be13dcf04f31d5bfe46b2f3 (patch)
tree4cd226d7c0ee3a748dcad74d2ede8ec4e835e43d /crates/ra_cli/src/progress_report.rs
parent27943bead6798cd202d7398f38cecfd3f5840645 (diff)
Fill all last text to space and return the cursor
Diffstat (limited to 'crates/ra_cli/src/progress_report.rs')
-rw-r--r--crates/ra_cli/src/progress_report.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/ra_cli/src/progress_report.rs b/crates/ra_cli/src/progress_report.rs
index 6ce0d4cab..31867a1e9 100644
--- a/crates/ra_cli/src/progress_report.rs
+++ b/crates/ra_cli/src/progress_report.rs
@@ -107,7 +107,14 @@ impl ProgressReport {
107 } 107 }
108 108
109 fn clear(&mut self) { 109 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);
111 self.text = String::new(); 118 self.text = String::new();
112 } 119 }
113} 120}