fix: narrow VS-15 emoji width and make inline wrap ANSI/cluster-aware
Incorporate the correctness improvements from @ST33LDI9ITAL's #103 that this
grapheme stack was missing, while keeping the block-cursor cluster handling
that #103 had simplified away.
- grapheme.go: extract clusterExtendUpdateWidth, shared by clusterAdvance and
the inline wrap scanner. VS16 still forces width 2; VS15 (U+FE0E) now narrows
an emoji-wide base to width 1.
- inline_wrap.go: add nextClusterWidth, an ANSI-aware cluster scanner that
treats escape sequences as cluster boundaries, and route wrapInlineStyledRows
through it so a combining mark never attaches across an ANSI escape.
- grapheme_edge_test.go: port #103's edge-case suite (cluster snapping,
rune->display-column mapping, combining/ZWJ input editing, buffer round-trip,
ANSI and oversized wrapping), plus a load-bearing VS15 case (U+1F600 + VS15
narrows to width 1) that #103's own test missed.
Retains this branch's clusterRuneStarts helpers and the block-cursor
cluster-preservation fix (and its test) that #103 dropped.
grindlemire · Jun 19 · 2161ca1 · parent 821559d · 3 files +558 -0