mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-18 23:20:54 +00:00
replace old fix from 9713c4a25a
with improved consistency check
and avoid somewhat unexpected crash
This commit is contained in:
parent
ce30c3b294
commit
843b8c44f7
2 changed files with 48 additions and 66 deletions
|
@ -1353,9 +1353,7 @@ public final class InputLogic {
|
|||
if (!mConnection.hasSelection()
|
||||
&& settingsValues.isSuggestionsEnabledPerUserSettings()
|
||||
&& settingsValues.mSpacingAndPunctuations.mCurrentLanguageHasSpaces) {
|
||||
final TextRange range = mConnection.getWordRangeAtCursor(
|
||||
settingsValues.mSpacingAndPunctuations,
|
||||
currentKeyboardScript, false);
|
||||
final TextRange range = mConnection.getWordRangeAtCursor(settingsValues.mSpacingAndPunctuations, currentKeyboardScript);
|
||||
if (range != null) {
|
||||
return range.mWord.toString();
|
||||
}
|
||||
|
@ -1709,8 +1707,7 @@ public final class InputLogic {
|
|||
mConnection.finishComposingText();
|
||||
return;
|
||||
}
|
||||
final TextRange range =
|
||||
mConnection.getWordRangeAtCursor(settingsValues.mSpacingAndPunctuations, currentKeyboardScript, true);
|
||||
final TextRange range = mConnection.getWordRangeAtCursor(settingsValues.mSpacingAndPunctuations, currentKeyboardScript);
|
||||
if (null == range) return; // Happens if we don't have an input connection at all
|
||||
if (range.length() <= 0) {
|
||||
// Race condition, or touching a word in a non-supported script.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue