Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/ui/text.rs')
| -rw-r--r-- | helix-term/src/ui/text.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-term/src/ui/text.rs b/helix-term/src/ui/text.rs index a9c99562..c318052b 100644 --- a/helix-term/src/ui/text.rs +++ b/helix-term/src/ui/text.rs @@ -33,7 +33,7 @@ impl Component for Text { fn render(&mut self, area: Rect, surface: &mut Surface, _cx: &mut Context) { use tui::widgets::{Paragraph, Widget, Wrap}; - let par = Paragraph::new(&self.contents).wrap(Wrap { trim: false }); + let par = Paragraph::new(self.contents.clone()).wrap(Wrap { trim: false }); // .scroll(x, y) offsets par.render(area, surface); @@ -58,7 +58,7 @@ pub fn required_size(text: &tui::text::Text, max_text_width: u16) -> (u16, u16) let content_width = content.width() as u16; if content_width > max_text_width { text_width = max_text_width; - height += content_width.checked_div(max_text_width).unwrap_or(0); + height += content_width / max_text_width; } else if content_width > text_width { text_width = content_width; } |