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

Commit 56cf7889 authored by Eric Fischer's avatar Eric Fischer
Browse files

Don't offer to add numbers to the dictionary.

Only show the "add to dictionary" context menu item if the current word
contains at least one letter.

Bug 1877803
parent d058ee01
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -6916,6 +6916,17 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            }
        }

        boolean hasLetter = false;
        for (int i = start; i < end; i++) {
            if (Character.isLetter(mTransformed.charAt(i))) {
                hasLetter = true;
                break;
            }
        }
        if (!hasLetter) {
            return null;
        }

        if (start == end) {
            return null;
        }