Files
Odin/tests/core/text/edit
Karl Zylinski 1f9b4c4555 Add text field to utf8.Grapheme, fix caret translation by grapheme
`decode_grapheme_iterate` already computed the text of each grapheme
cluster, but `decode_grapheme_clusters` discarded it, forcing callers to
reconstruct each cluster's range by looking ahead to the next grapheme's
`byte_index`. Store it on `Grapheme` instead; it is a slice of the input
string, so no allocation is involved.

`core:text/edit` was using `Grapheme.width` -- the number of monospace
cells -- as a byte count when moving the caret by grapheme, so it landed
in the middle of a cluster for anything wider than one byte per cell. Use
`len(Grapheme.text)`, and add a test package for the translations.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 12:27:31 +02:00
..