fix url detction ignoring no-suggestions request, fixes #180

This commit is contained in:
Helium314 2023-09-25 06:04:04 +02:00
parent d8c80b72ff
commit a330e9dd17

View file

@ -888,8 +888,9 @@ public final class InputLogic {
boolean isComposingWord = mWordComposer.isComposingWord();
// if we continue directly after a sometimesWordConnector, restart suggestions for the whole word
// (only with URL detection enabled)
if (settingsValues.mUrlDetectionEnabled && !isComposingWord && SpaceState.NONE == inputTransaction.getMSpaceState()
// (only with URL detection and suggestions enabled)
if (settingsValues.mUrlDetectionEnabled && settingsValues.needsToLookupSuggestions()
&& !isComposingWord && SpaceState.NONE == inputTransaction.getMSpaceState()
&& settingsValues.mSpacingAndPunctuations.isSometimesWordConnector(mConnection.getCodePointBeforeCursor())
// but not if there are two consecutive sometimesWordConnectors (e.g. "...bla")
&& !settingsValues.mSpacingAndPunctuations.isSometimesWordConnector(mConnection.getCharBeforeBeforeCursor())