From 478f15c9513913ce65af30c16eb19d851cc906f0 Mon Sep 17 00:00:00 2001 From: LeanBitLab Date: Wed, 25 Nov 2026 17:55:08 +0530 Subject: [PATCH] fix(suggest): drop title case variants of swiped words mid-sentence (#914) The title case filter from #914 only ran for typed input, so a word swiped without shift could still be committed as "Well" or "So" mid-sentence. Apply the same filter in the batch input path when the keyboard is not shifted or auto-capitalized. --- app/src/main/java/helium314/keyboard/latin/Suggest.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/helium314/keyboard/latin/Suggest.kt b/app/src/main/java/helium314/keyboard/latin/Suggest.kt index f01090cf4..906318f16 100644 --- a/app/src/main/java/helium314/keyboard/latin/Suggest.kt +++ b/app/src/main/java/helium314/keyboard/latin/Suggest.kt @@ -515,6 +515,10 @@ class Suggest(private val mDictionaryFacilitator: DictionaryFacilitator) { rejected = null } SuggestedWordInfo.removeDupsAndTypedWord(null, suggestionsContainer) + // Same as for typing: a word swiped mid-sentence without shift should not come out as "Well" or "So" + if (keyboardShiftMode == WordComposer.CAPS_MODE_OFF && !wordComposer.wasAutoCapitalized()) { + removeTitleCaseVariants(null, suggestionsContainer, mDictionaryFacilitator.currentLocale) + } makeFirstTwoSuggestionsNonEmoji(suggestionsContainer) // For some reason some suggestions with MIN_VALUE are making their way here.