SIGN IN SIGN UP

Handle surrogate pairs in RenderEditable (#55246)

The arrow key and delete handling in RenderEditable was using single
index values, which made it possible to move the cursor into the middle
of a surrogate pair (allowing things like adding text at that insertion
point), or to delete half of a surrogate pair. Since unpaired surrogate
pairs aren't valid UTF-16, doing so would cause assertions in the text
field.

This makes the arrow key and delete key handling surrogate-aware
(although not grapheme-cluster-aware, which is a larger fix that is out
of scope here).

Part of #55014
S
stuartmorgan committed
1cad96a63ecc76c10e3a6604ca8e113a846630af
Parent: 5f147b5
Committed by GitHub <noreply@github.com> on 4/22/2020, 7:21:03 PM