Fix a bug where spaces would be forgotten

Bug: 6785706
Change-Id: Ic7bf242ef058d116b986d47ad197b6d2802e2342
main
Jean Chalard 2012-07-06 17:50:35 +09:00
parent 362ea3cacb
commit 4fde56b818
1 changed files with 2 additions and 1 deletions

View File

@ -1799,6 +1799,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return;
}
mConnection.beginBatchEdit();
if (SPACE_STATE_PHANTOM == mSpaceState && suggestion.length() > 0) {
int firstChar = Character.codePointAt(suggestion, 0);
if ((!mCurrentSettings.isWeakSpaceStripper(firstChar))
@ -1816,7 +1817,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mKeyboardSwitcher.updateShiftState();
resetComposingState(true /* alsoResetLastComposedWord */);
final CompletionInfo completionInfo = mApplicationSpecifiedCompletions[index];
mConnection.beginBatchEdit();
mConnection.commitCompletion(completionInfo);
mConnection.endBatchEdit();
if (ProductionFlag.IS_EXPERIMENTAL) {
@ -1837,6 +1837,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mExpectingUpdateSelection = true;
commitChosenWord(suggestion, LastComposedWord.COMMIT_TYPE_MANUAL_PICK,
LastComposedWord.NOT_A_SEPARATOR);
mConnection.endBatchEdit();
// Don't allow cancellation of manual pick
mLastComposedWord.deactivate();
mSpaceState = SPACE_STATE_PHANTOM;