Type Editor / @type-editor/dom-change-util / parse-change/should-adjust-change-start-to-selection
parse-change/should-adjust-change-start-to-selection
Functions
| Function | Description |
|---|---|
Checks if change start should be adjusted to selection start. When typing at the start of a selection, if the typed character matches the character at the selection start, the diff algorithm might place the change start after that matching character. This function detects that case. The adjustment is needed when:
The threshold of 2 positions handles multi-byte characters and ensures we don't over-adjust. |