irregular-expressions icon indicating copy to clipboard operation
irregular-expressions copied to clipboard

Replacing selected text

Open nkrusch opened this issue 4 years ago • 2 comments

Could the keyboard be made to replace selected text with a different style?

nkrusch avatar Dec 27 '20 23:12 nkrusch

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.

nkrusch avatar Jul 24 '21 04:07 nkrusch

The easiest part of the decoding is probably regular characters.

  1. Detect if there are special characters. | If none, decode.
  2. Match selection with known styles. | If match, decode.
  3. 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.

NA0341 avatar Jan 07 '23 16:01 NA0341