diff --git a/yazi-plugin/src/elements/paragraph.rs b/yazi-plugin/src/elements/paragraph.rs index c2de6f74..9ace9892 100644 --- a/yazi-plugin/src/elements/paragraph.rs +++ b/yazi-plugin/src/elements/paragraph.rs @@ -77,6 +77,9 @@ impl UserData for Paragraph { }; Ok(ud) }); + methods.add_method("max_width", |_, me, ()| { + Ok(me.text.lines.iter().take(me.area.height as usize).map(|l| l.width()).max()) + }); } }