Skip to main content

truncate_mode

Function truncate_mode 

Source
pub fn truncate_mode(
    s: &str,
    length: usize,
    tail: &str,
    mode: WidthMode,
    eaw_wide: bool,
) -> String
Expand description

Width-mode variant of truncate.

mode and eaw_wide control grapheme width calculation. If the input already fits, it is returned unchanged; otherwise the visible prefix is shortened enough to fit tail, and trailing escape sequences are still copied.