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

Commit 8fc9bed9 authored by Mady Mellor's avatar Mady Mellor
Browse files

Text selection: When user reaches midpoint jump to end of word

Adjusts the point at which the handles jump to the end of the word.
Previously it was 1 or 2 characters depending on word length, now it
will use the midpoint of the word.

Bug: 21131483
Change-Id: I0d3c1bf4672ae27781318cf2563051cc66bb9f98
parent b0a8d2c4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4123,7 +4123,7 @@ public class Editor {
                if (!mInWord || currLine < mPrevLine) {
                    // We're not in a word, or we're on a different line so we'll expand by
                    // word. First ensure the user has at least entered the next word.
                    int offsetToWord = Math.min((end - start) / 2, 2);
                    int offsetToWord = (end - start) / 2;
                    if (offset <= end - offsetToWord || currLine < mPrevLine) {
                        offset = start;
                    } else {
@@ -4262,7 +4262,7 @@ public class Editor {
                if (!mInWord || currLine > mPrevLine) {
                    // We're not in a word, or we're on a different line so we'll expand by
                    // word. First ensure the user has at least entered the next word.
                    int midPoint = Math.min((end - start) / 2, 2);
                    int midPoint = (end - start) / 2;
                    if (offset >= start + midPoint || currLine > mPrevLine) {
                        offset = end;
                    } else {