Type Editor / @type-editor/dom-change-util / parse-change/needs-selection-overwrite-adjustment
parse-change/needs-selection-overwrite-adjustment
Functions
| Function | Description |
|---|---|
Checks if the change needs adjustment to handle typing over selection edge cases. When typing over a selection, there's an edge case: if the typed character matches the character at the start or end of the selection, the diff algorithm might detect a change that's smaller than the actual selection. This is because the diff sees matching characters and doesn't include them in the change range. For example, typing "t" over the selection "test" might be detected as just replacing "est" because the first "t" matches. This function detects when such adjustment is needed by checking:
See
|