summaryrefslogtreecommitdiffstats
path: root/src/config/input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/input.rs')
-rw-r--r--src/config/input.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/config/input.rs b/src/config/input.rs
index 6fa1b1c..cb3cdf2 100644
--- a/src/config/input.rs
+++ b/src/config/input.rs
@@ -80,7 +80,12 @@ impl Input {
}
pub fn summary(&self) -> String {
- let text = &self.text;
+ let text: String = self
+ .text
+ .trim()
+ .chars()
+ .map(|c| if c.is_control() { ' ' } else { c })
+ .collect();
if text.width_cjk() > 70 {
let mut sum_width = 0;
let mut chars = vec![];
@@ -94,7 +99,7 @@ impl Input {
}
chars.into_iter().collect()
} else {
- text.clone()
+ text
}
}