diff --git a/src/ui/widgets/editor.rs b/src/ui/widgets/editor.rs index 79646af..a707547 100644 --- a/src/ui/widgets/editor.rs +++ b/src/ui/widgets/editor.rs @@ -279,7 +279,7 @@ impl Widget for Editor { let min_width = lines .iter() - .map(|l| frame.width(l.text())) + .map(|l| frame.width(l.text().trim_end())) .max() .unwrap_or(0) + 1; diff --git a/src/ui/widgets/text.rs b/src/ui/widgets/text.rs index 43a9770..7cab2bb 100644 --- a/src/ui/widgets/text.rs +++ b/src/ui/widgets/text.rs @@ -40,7 +40,7 @@ impl Widget for Text { let lines = self.wrapped(frame, max_width); let min_width = lines .iter() - .map(|l| frame.width(l.text())) + .map(|l| frame.width(l.text().trim_end())) .max() .unwrap_or(0); let min_height = lines.len();