diff options
| author | 2025-05-13 12:15:18 -0400 | |
|---|---|---|
| committer | 2025-05-15 15:31:16 -0400 | |
| commit | 49843d6dc6cde85fe670085b809d41db314ec47d (patch) | |
| tree | bb36ee23debffab23c8066b5e8aee0a2b1b35ae1 /src/code_point.zig | |
| parent | Rewrite, passes WordBreakTest (diff) | |
| download | zg-49843d6dc6cde85fe670085b809d41db314ec47d.tar.gz zg-49843d6dc6cde85fe670085b809d41db314ec47d.tar.xz zg-49843d6dc6cde85fe670085b809d41db314ec47d.zip | |
Add wordAtCursor
This is not actually the way to do it, and can break on some crafted
strings. The way to actually do it: implement a reverse word search
iterator, then do next() to find a word break, prev() to find a
_valid_ word start, then next() again to find the valid end of said
word. Maybe 2+, 2-, 1+ actually.
I can probably write a test to see if the cursor spot is ambiguous,
and apply an extra round if so. Need to mull the rules over before
making any rash moves.
Diffstat (limited to 'src/code_point.zig')
0 files changed, 0 insertions, 0 deletions