aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/wrap.rs
blob: 2ba8d173ee1de4ea822771ba6f4d357624c87f32 (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, text_width: usize) -> SmartString<LazyCompact> {
    textwrap::refill(text, text_width).into()
}