From 00653c772e7df6f68071d1cb1c92bfe9ca4876f9 Mon Sep 17 00:00:00 2001 From: Mo Date: Tue, 27 Feb 2024 18:24:05 +0100 Subject: Avoid cloning the whole paragraph content just for rendering (#9739) * Avoid cloning the whole paragraph content just for rendering * Fix tests--- helix-term/src/ui/info.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'helix-term/src/ui/info.rs') diff --git a/helix-term/src/ui/info.rs b/helix-term/src/ui/info.rs index cc6b7483..651e5ca9 100644 --- a/helix-term/src/ui/info.rs +++ b/helix-term/src/ui/info.rs @@ -2,6 +2,7 @@ use crate::compositor::{Component, Context}; use helix_view::graphics::{Margin, Rect}; use helix_view::info::Info; use tui::buffer::Buffer as Surface; +use tui::text::Text; use tui::widgets::{Block, Borders, Paragraph, Widget}; impl Component for Info { @@ -31,7 +32,7 @@ impl Component for Info { let inner = block.inner(area).inner(&margin); block.render(area, surface); - Paragraph::new(self.text.as_str()) + Paragraph::new(&Text::from(self.text.as_str())) .style(text_style) .render(inner, surface); } -- cgit v1.2.3-70-g09d2