aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/wrap.rs
blob: eabc47d471dda4e666d6ef6d9fa3068eaaa36ef6 (plain) (blame)
1
2
3
4
5
6
7
use smartstring::{LazyCompact, SmartString};

/// Given a slice of text, return the text re-wrapped to fit it
/// within the given width.
pub fn reflow_hard_wrap(text: &str, max_line_len: usize) -> SmartString<LazyCompact> {
    textwrap::refill(text, max_line_len).into()
}