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

Commit 2a914cb3 authored by James Cook's avatar James Cook Committed by Android (Google) Code Review
Browse files

Merge "Handle undo in TextView fields with no cursor"

parents b1febc7f 900185d0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4887,9 +4887,10 @@ public class Editor {
                    text.insert(newTextInsertAt, newText);
                }
            }
            // Restore the cursor position.
            // Restore the cursor position. If there wasn't an old cursor (newCursorPos == -1) then
            // don't explicitly set it and rely on SpannableStringBuilder to position it.
            // TODO: Select all the text that was undone.
            if (newCursorPos <= text.length()) {
            if (0 <= newCursorPos && newCursorPos <= text.length()) {
                Selection.setSelection(text, newCursorPos);
            }
        }