51344b9a5b86fc9d46c2acebd7f766d8fe0c65f8
ApplyIMECommitToModel computed the caret pushed to the IME right after a commit as Range.End + len(text). That is correct for a plain insertion (Start == End) but wrong for a replacement — the case a swipe/autocorrect over a selection produces: the inserted text starts at Range.Start, so the caret is Range.Start + len(text). A 4-rune replacement (the 'samet' autocorrect on the phone) pushed the caret 4 runes past the inserted text, desynchronizing the IME's caret from ours at exactly the moment its local model was being updated; the persistent 4-rune drift that followed (every commit 4 runes ahead, then the empty-fix-up loop) matches this. The logic side (applyIMECommitBytes) already computed the correct caret; this aligns the renderer's immediate push with it. Also log every IME push (snippet restarts, selection updates, commit pushes) from the renderer: the phone incident's logcat rotated before it could be re-analyzed, so the next occurrence must be reconstructable from what we actually pushed to the IME.
Description
A simple, high performance text editor.
50 MiB
Languages
Go
92.7%
Shell
4.7%
Java
1.1%
C
0.8%
Python
0.7%