We need a callback for detecting when the document plain text has changed but timed to be triggered after the build. Such that we can extract the latest rectangles as well. the current callbacks don't work:
onReplaceText() - Called way to early, even before the document.changes stream
document.changes - The stream emits only changes (not complete docs) before the build is completed
onBuildComplete() - This one emits way too often, on hovering highlights, on selection changes, etc
Add new callback: onTextReplaceComplete(). Thanks to this new callback we can avoid comparing via onBuildComplete() the new text and the old text to see if the text has changed. Therefore the editor will be more performant, especially for large documents.
We need a callback for detecting when the document plain text has changed but timed to be triggered after the build. Such that we can extract the latest rectangles as well. the current callbacks don't work:
onReplaceText()
- Called way to early, even before thedocument.changes
streamdocument.changes
- The stream emits only changes (not complete docs) before the build is completedonBuildComplete()
- This one emits way too often, on hovering highlights, on selection changes, etcAdd new callback:
onTextReplaceComplete()
. Thanks to this new callback we can avoid comparing viaonBuildComplete()
the new text and the old text to see if the text has changed. Therefore the editor will be more performant, especially for large documents.