am 8174373a: Merge "Remove a nested edition occurence"
* commit '8174373a0ed11aaaf6d5cdfc9065e6b8641b19a6': Remove a nested edition occurencemain
commit
d437bab53b
|
@ -1400,7 +1400,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SPACE_STATE_DOUBLE == spaceState) {
|
if (SPACE_STATE_DOUBLE == spaceState) {
|
||||||
if (revertDoubleSpace(ic)) {
|
if (revertDoubleSpaceWhileInBatchEdit(ic)) {
|
||||||
// No need to reset mSpaceState, it has already be done (that's why we
|
// No need to reset mSpaceState, it has already be done (that's why we
|
||||||
// receive it as a parameter)
|
// receive it as a parameter)
|
||||||
return;
|
return;
|
||||||
|
@ -2205,7 +2205,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
}
|
}
|
||||||
|
|
||||||
// "ic" must not be null
|
// "ic" must not be null
|
||||||
private boolean revertDoubleSpace(final InputConnection ic) {
|
private boolean revertDoubleSpaceWhileInBatchEdit(final InputConnection ic) {
|
||||||
mHandler.cancelDoubleSpacesTimer();
|
mHandler.cancelDoubleSpacesTimer();
|
||||||
// Here we test whether we indeed have a period and a space before us. This should not
|
// Here we test whether we indeed have a period and a space before us. This should not
|
||||||
// be needed, but it's there just in case something went wrong.
|
// be needed, but it's there just in case something went wrong.
|
||||||
|
@ -2218,10 +2218,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
+ "\". \" just before the cursor.");
|
+ "\". \" just before the cursor.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ic.beginBatchEdit();
|
|
||||||
ic.deleteSurroundingText(2, 0);
|
ic.deleteSurroundingText(2, 0);
|
||||||
ic.commitText(" ", 1);
|
ic.commitText(" ", 1);
|
||||||
ic.endBatchEdit();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue