-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
text_util: add functions to truncate labeled text
This will be used by truncate_start/end() template functions. I considered adding a template function that supports both padding and truncation, but the function interface looked a bit messy. There may be (max_width, ellipsis, left|middle|right) parameters for truncation, and (min_width, fill_char, left|center|right) for padding. I'm not going to add ellipsis and centering support, but it's weird if pad(center) implied truncate(middle).
- Loading branch information
Showing
1 changed file
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters