typewriter-editor / typewriter

A rich text editor based off of Quill.js and Ultradom, and using Svelte for UI.
MIT License
394 stars 32 forks source link

Use fast-diff's cursor position. #75

Closed taylorhadden closed 3 years ago

taylorhadden commented 3 years ago

This fixes an error where inserting a character before a string of the same character reported the change as occurring at the end of the character span, rather than the actual insertion position. This should fix issue #74.

I have tested this as working by inserting characters before and in a string of duplicate characters (e.g. "mm" to "mmm") and verifying that the [{ retain: <number>}, { insert: 'm' }] values are occurring at the correct position.

jacwright commented 3 years ago

Thank you for the PR!