Pad/internal
Greg Pomerantz 9b782190fa editor: honor key.EditEvent.Range in HandleReplaceRange (IME swipe/autocorrect)
The IME commit path (swipe-to-type, autocorrect replacement) sends a
key.EditEvent with a Range that the editor ignored, causing the replaced
region to be duplicated. Add Logic.HandleReplaceRange which deletes the
rune range [start,end) and inserts text, converting rune indices to byte
offsets (string path: utf8.DecodeRuneInString; chunked path: leading-byte
scan). HandleKeyDown now routes key.EditEvent through it.

Also fixes two pre-existing ChunkedBuffer correctness bugs the tests
exposed:
- Delete mis-computed the per-chunk end using a shrinking 'remaining'
  instead of the absolute end, corrupting multi-chunk deletes.
- FullContent derived its chunk bound solely from fileLen, truncating
  in-memory chunks grown past the old bound by an insert.

Adds ime_range_test.go covering insert/replace/delete, unicode, chunked,
and swapped bounds. go test -race ./... green.
2026-08-16 02:18:44 -04:00
..
browser Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
editor editor: honor key.EditEvent.Range in HandleReplaceRange (IME swipe/autocorrect) 2026-08-16 02:18:44 -04:00
io/pool Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
test/e2e Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
ui Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00