diff options
author | Edwin Cheng <[email protected]> | 2019-11-26 21:01:13 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-11-26 21:01:13 +0000 |
commit | f0aaf3b2964a26a08be13dcf04f31d5bfe46b2f3 (patch) | |
tree | 4cd226d7c0ee3a748dcad74d2ede8ec4e835e43d | |
parent | 27943bead6798cd202d7398f38cecfd3f5840645 (diff) |
Fill all last text to space and return the cursor
-rw-r--r-- | crates/ra_cli/src/progress_report.rs | 9 |
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 | } |