Partially revert I531a3257 as it mistakenly broke some logic -- textToTheLeft was required.

Change-Id: I24f55cec05fea68836d6b3413b69f1e1b9c68ba2
main
Ken Wakasa 2011-08-06 22:37:45 +09:00
parent 6983cf4a19
commit 20c4aec827
1 changed files with 4 additions and 3 deletions

View File

@ -1930,15 +1930,16 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
}
final CharSequence separator = ic.getTextBeforeCursor(1, 0);
ic.deleteSurroundingText(mCommittedLength + 1 /* separator */, 0);
ic.deleteSurroundingText(1, 0);
final CharSequence textToTheLeft = ic.getTextBeforeCursor(mCommittedLength, 0);
ic.deleteSurroundingText(mCommittedLength, 0);
// Re-insert "separator" only when the deleted character was word separator and the
// composing text wasn't equal to the auto-corrected text which can be found before
// the cursor.
if (!TextUtils.isEmpty(separator)
&& mSettingsValues.isWordSeparator(separator.charAt(0))
&& !TextUtils.equals(mComposingStringBuilder,
ic.getTextBeforeCursor(mCommittedLength, 0))) {
&& !TextUtils.equals(mComposingStringBuilder, textToTheLeft)) {
ic.commitText(mComposingStringBuilder, 1);
TextEntryState.acceptedTyped(mComposingStringBuilder);
ic.commitText(separator, 1);