Partially revert I531a3257 as it mistakenly broke some logic -- textToTheLeft was required.
Change-Id: I24f55cec05fea68836d6b3413b69f1e1b9c68ba2
This commit is contained in:
parent
6983cf4a19
commit
20c4aec827
1 changed files with 4 additions and 3 deletions
|
@ -1930,15 +1930,16 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
}
|
}
|
||||||
|
|
||||||
final CharSequence separator = ic.getTextBeforeCursor(1, 0);
|
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
|
// 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
|
// composing text wasn't equal to the auto-corrected text which can be found before
|
||||||
// the cursor.
|
// the cursor.
|
||||||
if (!TextUtils.isEmpty(separator)
|
if (!TextUtils.isEmpty(separator)
|
||||||
&& mSettingsValues.isWordSeparator(separator.charAt(0))
|
&& mSettingsValues.isWordSeparator(separator.charAt(0))
|
||||||
&& !TextUtils.equals(mComposingStringBuilder,
|
&& !TextUtils.equals(mComposingStringBuilder, textToTheLeft)) {
|
||||||
ic.getTextBeforeCursor(mCommittedLength, 0))) {
|
|
||||||
ic.commitText(mComposingStringBuilder, 1);
|
ic.commitText(mComposingStringBuilder, 1);
|
||||||
TextEntryState.acceptedTyped(mComposingStringBuilder);
|
TextEntryState.acceptedTyped(mComposingStringBuilder);
|
||||||
ic.commitText(separator, 1);
|
ic.commitText(separator, 1);
|
||||||
|
|
Loading…
Reference in a new issue