This commit is contained in:
sxyazi 2024-09-21 01:46:29 +08:00
parent 87e9f3c737
commit bf2e61d28d
No known key found for this signature in database

View file

@ -77,6 +77,9 @@ impl UserData for Paragraph {
}; };
Ok(ud) Ok(ud)
}); });
methods.add_method("max_width", |_, me, ()| {
Ok(me.text.lines.iter().take(me.area.height as usize).map(|l| l.width()).max())
});
} }
} }