Type Editor / @type-editor/dom-change-util / parse-change/should-adjust-change-end-to-selection
parse-change/should-adjust-change-end-to-selection
Functions
| Function | Description |
|---|---|
Checks if change end should be adjusted to selection end. Similar to start adjustment, when typing at the end of a selection, if the typed character matches the character at the selection end, the diff algorithm might place the change end before that matching character. This function detects that case. The adjustment is needed when:
When this condition is met, both endA and endB of the change are adjusted to match the selection boundary. |