new dev bug: moving the cursor manually, while filtering Chinese words, produces unexpected characters
This commit is contained in:
parent
5554110b7d
commit
f8d7af669d
3 changed files with 9 additions and 5 deletions
|
|
@ -327,11 +327,8 @@ public abstract class TypingHandler extends KeyPadHandler {
|
||||||
// If the cursor moves while composing a word (usually, because the user has touched the screen outside the word), we must
|
// If the cursor moves while composing a word (usually, because the user has touched the screen outside the word), we must
|
||||||
// end typing end accept the word. Otherwise, the cursor would jump back at the end of the word, after the next key press.
|
// end typing end accept the word. Otherwise, the cursor would jump back at the end of the word, after the next key press.
|
||||||
// This is confusing from user perspective, so we want to avoid it.
|
// This is confusing from user perspective, so we want to avoid it.
|
||||||
if (
|
if (CursorOps.isMovedManually(newSelStart, newSelEnd, candidatesStart, candidatesEnd)) {
|
||||||
CursorOps.isMovedManually(newSelStart, newSelEnd, candidatesStart, candidatesEnd)
|
mInputMode.onCursorMove(suggestionOps.acceptIncomplete());
|
||||||
&& !suggestionOps.isEmpty()
|
|
||||||
) {
|
|
||||||
mInputMode.onAcceptSuggestion(suggestionOps.acceptIncomplete());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ abstract public class InputMode {
|
||||||
// Suggestions
|
// Suggestions
|
||||||
public void onAcceptSuggestion(@NonNull String word) { onAcceptSuggestion(word, false); }
|
public void onAcceptSuggestion(@NonNull String word) { onAcceptSuggestion(word, false); }
|
||||||
public void onAcceptSuggestion(@NonNull String word, boolean preserveWordList) {}
|
public void onAcceptSuggestion(@NonNull String word, boolean preserveWordList) {}
|
||||||
|
public void onCursorMove(@NonNull String word) { if (!digitSequence.isEmpty()) onAcceptSuggestion(word); }
|
||||||
public void onReplaceSuggestion(@NonNull String word) {}
|
public void onReplaceSuggestion(@NonNull String word) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,12 @@ public class ModeIdeograms extends ModeWords {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override public void onCursorMove(@NonNull String word) {
|
||||||
|
isFiltering = false;
|
||||||
|
super.onCursorMove(word);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldAcceptPreviousSuggestion(String s) {
|
public boolean shouldAcceptPreviousSuggestion(String s) {
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue