Commit fa81a11
authored
fix(ios): use controlled path for Cut to prevent formatting corruption (#278)
* fix(ios): prevent crash when deleting mixed selection or using IME input
Always update _lastSelectedRange in textViewDidChangeSelection and
textInputDidChangeSelection before the isApplyingFormatting guard,
ensuring _preEditSelectedRange is never stale when handleTextChanged
computes edit parameters. Also clamp modificationRange passed to the
detector pipeline so out-of-bounds values cannot reach ENRMWordsUtils.
Made-with: Cursor
* fix(ios): use controlled path for Cut to prevent formatting corruption
Route Cut through replaceSelectedTextWith:formattingRanges: instead of
UIKit's replaceRange:withText: (iOS) / insertText:replacementRange:
(macOS). The controlled path bypasses the delegate chain and calls
adjustForEditAtLocation: with exact parameters, eliminating timing
races that corrupt the formatting store on slower devices or low
power mode.
Made-with: Cursor1 parent 78b4419 commit fa81a11
3 files changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
| 114 | + | |
117 | 115 | | |
118 | 116 | | |
119 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
0 commit comments