Skip to content
Commit 80afe268 authored by Nicolas Fella's avatar Nicolas Fella Committed by Albert Astals Cid
Browse files

Implement event.change

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
parent 69a2cc14
Pipeline #231550 passed with stage
in 6 minutes and 26 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment