mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-03 05:04:45 +00:00
Disable autocorrect during URL and email input
Disables autocorrect when the user is typing in a URL or email, since many websites and emails are deliberate misspellings of dictionary words. For example, typing "openboard." (for a hypothetical website "openboard.com"), the keyboard should not "correct" this to "open board.".
This commit is contained in:
parent
ef7c4ba318
commit
c1a96f9aea
1 changed files with 5 additions and 0 deletions
|
@ -20,6 +20,7 @@ import android.text.TextUtils;
|
|||
import android.util.Log;
|
||||
|
||||
import org.dslul.openboard.inputmethod.keyboard.Keyboard;
|
||||
import org.dslul.openboard.inputmethod.keyboard.KeyboardId;
|
||||
import org.dslul.openboard.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
|
||||
import org.dslul.openboard.inputmethod.latin.common.Constants;
|
||||
import org.dslul.openboard.inputmethod.latin.common.StringUtils;
|
||||
|
@ -217,6 +218,10 @@ public final class Suggest {
|
|||
|| wordComposer.isMostlyCaps()
|
||||
// We never auto-correct when suggestions are resumed because it would be unexpected
|
||||
|| wordComposer.isResumed()
|
||||
// We don't autocorrect in URL or email input, since websites and emails can be
|
||||
// deliberate misspellings of actual words
|
||||
|| keyboard.mId.mMode == KeyboardId.MODE_URL
|
||||
|| keyboard.mId.mMode == KeyboardId.MODE_EMAIL
|
||||
// If we don't have a main dictionary, we never want to auto-correct. The reason
|
||||
// for this is, the user may have a contact whose name happens to match a valid
|
||||
// word in their language, and it will unexpectedly auto-correct. For example, if
|
||||
|
|
Loading…
Add table
Reference in a new issue