Re: [w3c/editing] Should we expose physical direction in Deletion commands? (for the case of RTL) (#133)

> Yes, probably. At the same time, figuring out whether you're supposed to delete a single character, or the whole grapheme cluster is language dependent (and seems to be dependent of what you want to do with it, as it was earlier mentioned that you may not want to do the same when deleting forward and backward), it looks a bit tricky.

Yes, but as you mentioned, there may be variations in how to handle it from JS editor to JS editor. And from the CK editor discussion linked above, it seems like there are JS libraries to figure out about graphemes and code points. I guess one can guess which script is in use by looking at what unicode characters have been used.

> My goal here isn't so much to expose a general purpose text/unicode API allowing you to do all manners of smart things, but to help naïvely programmed editors to deal with international text simply without screwing everything up.

What are you proposing concretely?

I think the naively programmed editor will get most out of examples on this. As an editor developer, one currently has to spend a fair amount of time on creating a working minimal editor anyway (no less than 1-3 years if you have written another one before, else 3-8 years). And once you get the concept that in some languages graphemes consist of more than one character, you will also be able to write the 1 line check to see if we are just deleting text and if so, how many unicode characters using the targetRange. This should already make it a lot easier to handle this correctly than what is currently the case.

Also, we can add those examples to the description text for the inputtype, but right now I cannot think of how to add that without making it even more convoluted. Any suggestions on how to change:

> If the user intends to delete the content directly after
                    the caret position and this intention is not covered by another
                    inputType or the user itends to delete a non-collapsed selection
                    with the selection collapsing to its end after the deletion,
                    using a keyboard, speech, or similar method, the inputType
                    MUST be

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/133#issuecomment-236566542

Received on Monday, 1 August 2016 12:30:46 UTC