irregular-expressions
irregular-expressions copied to clipboard
Replacing selected text
Could the keyboard be made to replace selected text with a different style?
TODO: When changing selected style, if there is active selection, replace the selected charsequence with the a charsequence encoded in the newly selected style & maintain the selection. ~It should be fairly straightforward?~ Spoke too soon, need to "decode" before being able to encode in a different style. May need to use a string builder. I think this is related to the delete key behavior.
The easiest part of the decoding is probably regular characters.
- Detect if there are special characters. | If none, decode.
- Match selection with known styles. | If match, decode.
- Try to interpret the selected text. (There are unified tools to do this. Maybe ready made libs exist too?)
I think this is related to the delete key behavior.
Every other keyboard I used deleted special characters as intended (OpenBoard, Hacker's Keyboard, Unexpected Keyboard, …).
This seems to be a rather weird bug.