Module text_util

Source

Functions§

complete_newline
elide_end
Shortens text to max_width by removing trailing characters. ellipsis is added if the text gets truncated.
elide_start
Shortens text to max_width by removing leading characters. ellipsis is added if the text gets truncated.
parse_author
split_email
wrap_bytes
Wraps lines at the given width, returns a vector of lines (excluding “\n”.)
write_indented
Indents each line by the given prefix preserving labels.
write_padded_centered
Writes text padded to min_width by adding leading and trailing fill characters.
write_padded_end
Writes text padded to min_width by adding leading fill characters.
write_padded_start
Writes text padded to min_width by adding leading fill characters.
write_truncated_end
Writes text truncated to max_width by removing trailing characters. Returns width of the truncated text, which may be shorter than max_width.
write_truncated_start
Writes text truncated to max_width by removing leading characters. Returns width of the truncated text, which may be shorter than max_width.
write_wrapped
Wraps lines at the given width preserving labels.