mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Add a workaround for a reported backspace issue in some apps
This commit is contained in:
parent
a237248fc9
commit
fdffadf6fb
@ -216,6 +216,13 @@ public final class RichInputConnection implements PrivateCommandPerformer {
|
||||
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
|
||||
}
|
||||
|
||||
public void restartBatchEdit() {
|
||||
if(mNestLevel == 1) {
|
||||
endBatchEdit();
|
||||
beginBatchEdit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the cached text and retrieve it again from the editor.
|
||||
*
|
||||
@ -723,6 +730,12 @@ public final class RichInputConnection implements PrivateCommandPerformer {
|
||||
if (!isConnected()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// In some editors, due to batch edit, we will receive stale information after having
|
||||
// just performed an action (e.g. deleted text). Restarting batch edit will force
|
||||
// the editor to process actions so far
|
||||
restartBatchEdit();
|
||||
|
||||
final CharSequence before = getTextBeforeCursorAndDetectLaggyConnection(
|
||||
OPERATION_GET_WORD_RANGE_AT_CURSOR,
|
||||
SLOW_INPUT_CONNECTION_ON_PARTIAL_RELOAD_MS,
|
||||
|
Loading…
Reference in New Issue
Block a user