Skip to content

Commit

Permalink
adapt last commit dc4755b to Helium314#688
Browse files Browse the repository at this point in the history
  • Loading branch information
codokie committed May 31, 2024
1 parent dc4755b commit 12cddf4
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions app/src/main/java/helium314/keyboard/latin/LatinIME.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ public boolean hasPendingUpdateSuggestions() {
return hasMessages(MSG_UPDATE_SUGGESTION_STRIP);
}

public boolean hasPendingResumeSuggestions() {
return hasMessages(MSG_RESUME_SUGGESTIONS);
}

public boolean hasPendingReopenDictionaries() {
return hasMessages(MSG_REOPEN_DICTIONARIES);
}
Expand Down Expand Up @@ -984,6 +988,9 @@ void onStartInputViewInternal(final EditorInfo editorInfo, final boolean restart
// initialSelStart and initialSelEnd sometimes are lying. Make a best effort to
// work around this bug.
mInputLogic.mConnection.tryFixLyingCursorPosition();
if (mInputLogic.mConnection.isCursorTouchingWord(currentSettingsValues.mSpacingAndPunctuations, true)) {
mHandler.postResumeSuggestions(true /* shouldDelay */);
}
needToCallLoadKeyboardLater = false;
}
} else {
Expand Down Expand Up @@ -1012,9 +1019,12 @@ void onStartInputViewInternal(final EditorInfo editorInfo, final boolean restart
// Space state must be updated before calling updateShiftState
switcher.requestUpdatingShiftState(getCurrentAutoCapsState(), getCurrentRecapitalizeState());
}

mHandler.cancelUpdateSuggestionStrip();
mHandler.postResumeSuggestions(true /* shouldDelay */);
// This will set the punctuation suggestions if next word suggestion is off;
// otherwise it will clear the suggestion strip.
if (!mHandler.hasPendingResumeSuggestions()) {
mHandler.cancelUpdateSuggestionStrip();
setNeutralSuggestionStrip();
}

mainKeyboardView.setMainDictionaryAvailability(mDictionaryFacilitator.hasAtLeastOneInitializedMainDictionary());
mainKeyboardView.setKeyPreviewPopupEnabled(currentSettingsValues.mKeyPreviewPopupOn);
Expand Down

1 comment on commit 12cddf4

@codokie
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, I meant adapt to Helium314#674, not Helium314#688..

Please sign in to comment.