pub fn truncate_mode(
s: &str,
length: usize,
tail: &str,
mode: WidthMode,
eaw_wide: bool,
) -> StringExpand 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.