PolicyStat / ckeditor-spell-check-plugin-js-dev-edge

User interface enhancements and beta features for http://ckeditor-spellcheck.nanospell.com . This repo is for nanospell developers and trusted partners to modify and fork plugin.js
Other
0 stars 0 forks source link

Stop creating bookmarks when touching blocks that the selection is not in #38

Closed caffodian closed 7 years ago

caffodian commented 8 years ago

I was talking through this problem and then realized this is horrible to do. This must be leftover cruft from the initial "touch the whole document" version.

caffodian commented 8 years ago

Articulating some points better:

Doing one bookmark per batch is nice. However, restoring bookmarks is expensive regardless of whether it actually does something visible to the user (because span removal is required, or checks are required.)

Also, by creating the bookmark only once per batch, we create problems when you have multiple excessively large blocks. Because things are now more responsive, it's possible to do more things and get the selection restored to the wrong place.

caffodian commented 8 years ago

We need to:

caffodian commented 8 years ago

I might be going insane but it's possible that with all the various changes we made along the way, that bookmarking is no longer needed (except for span removal)

caffodian commented 8 years ago

One ugly case we don't handle properly (which makes figuring out bookmarks difficult) - if a word is actually multiple text nodes and you type into the middle of it

caffodian commented 8 years ago

The render event already takes a rootElement. Is it sufficient to determine if the selection falls inside?