Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f51becbf authored by Haoyu Zhang's avatar Haoyu Zhang
Browse files

Make the insert mode highlight sticky

This CL fixes the issue that in some Apps the insert mode highlight
is applied to the entire text range after an editing. This is caused
by App call text.replace(0, text.length(), newText) after each edit.
Here the newText is usually a copy of text that has different spans.
And Apps use this trick to update the spans on the text. However, it
tricks the insert mode to think that the entire string is replaced.
This Cl fixed the issue by making the highlight range sticky when the
text replace range covers the highlight range.

Bug: 355137282
Test: atest InsertModeTransformationMethod
Flag: com.android.text.flags.insert_mode_highlight_range

Change-Id: I46dd0f22db0287a51a6f8fda6ea2c8514c2e4b63
parent 5d157cee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment