diff options
author | Mo | 2024-02-27 17:24:05 +0000 |
---|---|---|
committer | GitHub | 2024-02-27 17:24:05 +0000 |
commit | 00653c772e7df6f68071d1cb1c92bfe9ca4876f9 (patch) | |
tree | ab89132d7fc7d174216264bd367942e9589b2269 /helix-term/src/ui/editor.rs | |
parent | 26b3dc29be886c5a2ed1a5caaaf09eb730829c3e (diff) |
Avoid cloning the whole paragraph content just for rendering (#9739)
* Avoid cloning the whole paragraph content just for rendering
* Fix tests
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r-- | helix-term/src/ui/editor.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 15a7262a..dffaeea0 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -716,7 +716,8 @@ impl EditorView { } } - let paragraph = Paragraph::new(lines) + let text = Text::from(lines); + let paragraph = Paragraph::new(&text) .alignment(Alignment::Right) .wrap(Wrap { trim: true }); let width = 100.min(viewport.width); |