Documentation
¶
Overview ¶
Package text holds the small string helpers that were re-implemented across the tree: rune-safe clipping (one of the copies sliced bytes and could split a multibyte character), single-line collapsing, and multi-substring matching. Classification predicates and display truncation both hang on these, so they live once. Display-width truncation for the TUI is a different concern (cell width, ANSI sequences) and stays with the TUI's ansi tooling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clip ¶
Clip shortens s to at most n runes, appending "..." when it cut. The cut end is trimmed of trailing spaces so a clip never renders " ...". Rune-based on purpose: a byte slice can split a multibyte character and produce invalid UTF-8.
func ContainsAny ¶
ContainsAny reports whether s contains any of the substrings. Callers normalize case themselves when they need to.
Types ¶
This section is empty.