Skip to content

Implement event.change

Nicolas Fella requested to merge work/change into master

This represents the newly entered data for each keystroke. This is often a single added character, but for cases like pasting text it can be more complex.

The PDF API reference doesn't specify any algorithm to use.

The algorithm used here works by iterating through both strings from the start until the first different character is encountered. Then the rest of the new text is considered the difference.

This doesn't produce the theoretically optimal/minimal diff, but seems to work well enough for practical application.

When text is removed the diff is empty

Merge request reports