- New
ControlSequences8Bitoption to treat 8-bit ECMA-48 (C1) escape sequences as zero-width. (#22)
- Upgraded uax29 dependency to v2.7.0 for 8-bit escape sequence support in the grapheme iterator.
- Truncation now validates that preserved trailing escape sequences are zero-width, preventing edge cases where non-zero-width sequences could leak into output.
ControlSequences8Bitis deliberately ignored byTruncateStringandTruncateBytes, because C1 byte values (0x80–0x9F) overlap with UTF-8 multi-byte encoding.
- New
ControlSequencesoption to treat ECMA-48/ANSI escape sequences as zero-width. (#20) TruncateStringandTruncateBytesnow preserve trailing ANSI escape sequences (such as SGR resets) whenControlSequencesis true, preventing color bleed in terminal output.
- Removed
stringishdependency; generic type constraints are now inline~string | []byte. - Upgraded uax29 dependency to v2.6.0 for ANSI escape sequence support in the grapheme iterator.
- Unicode 17 support: East Asian Width and emoji data updated to Unicode 17.0.0. (#18)
- Upgraded uax29 dependency to v2.5.0 (Unicode 17 grapheme segmentation).
- Performance: ASCII fast path that applies to any run of printable ASCII. 2x-10x faster for ASCII text vs v0.7.0. (#16)
- Upgraded uax29 dependency to v2.4.0 for Unicode 16 support. Text that includes Indic_Conjunct_Break may segment differently (and more correctly). (#15)
- New
TruncateStringandTruncateBytesmethods to truncate strings to a maximum display width, with optional tail (like an ellipsis). (#13)
- Internal: reduced property categories for simpler trie.
- Perf improvements: replaced the ASCII lookup table with a simple function. A bit more cache-friendly. More inlining.
- Bug fix: single regional indicators are now treated as width 2, since that is what actual terminals do.
- New
StringGraphemesandBytesGraphemesmethods, for iterating over the widths of grapheme clusters.
- Fast ASCII lookups
- Unicode 16 support
- Improved emoji presentation handling per Unicode TR51
- Corrected VS15 (U+FE0E) handling: now preserves base character width (no-op) per Unicode TR51
- Performance optimizations: reduced property lookups
- VS15 variation selector now correctly preserves base character width instead of forcing width 1
- Updated uax29 dependency
- Improved flag handling
- Support for variation selectors (VS15, VS16) and regional indicator pairs (flags)
- Fuzz testing support
- Updated stringish dependency
- Dropped compatibility with go-runewidth
- Trie implementation cleanup