mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Reset the suggestion status when composing span gets cleared
bug: 3353818 Change-Id: I87b80470015dbeb2eaaec9aa4d9d802597c18e19
This commit is contained in:
parent
952cb7e973
commit
025a5e356e
@ -694,6 +694,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.i(TAG, "onUpdateSelection: oss=" + oldSelStart
|
Log.i(TAG, "onUpdateSelection: oss=" + oldSelStart
|
||||||
+ ", ose=" + oldSelEnd
|
+ ", ose=" + oldSelEnd
|
||||||
|
+ ", lss=" + mLastSelectionStart
|
||||||
|
+ ", lse=" + mLastSelectionEnd
|
||||||
+ ", nss=" + newSelStart
|
+ ", nss=" + newSelStart
|
||||||
+ ", nse=" + newSelEnd
|
+ ", nse=" + newSelEnd
|
||||||
+ ", cs=" + candidatesStart
|
+ ", cs=" + candidatesStart
|
||||||
@ -704,9 +706,18 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
|
|
||||||
// If the current selection in the text view changes, we should
|
// If the current selection in the text view changes, we should
|
||||||
// clear whatever candidate text we have.
|
// clear whatever candidate text we have.
|
||||||
if ((((mComposing.length() > 0 && mHasValidSuggestions)
|
final boolean selectionChanged = (newSelStart != candidatesEnd
|
||||||
|| mVoiceConnector.isVoiceInputHighlighted()) && (newSelStart != candidatesEnd
|
|| newSelEnd != candidatesEnd) && mLastSelectionStart != newSelStart;
|
||||||
|| newSelEnd != candidatesEnd) && mLastSelectionStart != newSelStart)) {
|
final boolean candidatesCleared = candidatesStart == -1 && candidatesEnd == -1;
|
||||||
|
if (((mComposing.length() > 0 && mHasValidSuggestions)
|
||||||
|
|| mVoiceConnector.isVoiceInputHighlighted())
|
||||||
|
&& (selectionChanged || candidatesCleared)) {
|
||||||
|
if (candidatesCleared) {
|
||||||
|
// If the composing span has been cleared, save the typed word in the history for
|
||||||
|
// recorrection before we reset the candidate strip. Then, we'll be able to show
|
||||||
|
// suggestions for recorrection right away.
|
||||||
|
saveWordInHistory(mComposing);
|
||||||
|
}
|
||||||
mComposing.setLength(0);
|
mComposing.setLength(0);
|
||||||
mHasValidSuggestions = false;
|
mHasValidSuggestions = false;
|
||||||
mHandler.postUpdateSuggestions();
|
mHandler.postUpdateSuggestions();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user