Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
2e107841
Commit
2e107841
authored
11 years ago
by
Jean Chalard
Committed by
Android Git Automerger
11 years ago
Browse files
Options
Downloads
Plain Diff
am
be3be424
: Fix a bug that happens upon a race condition
* commit '
be3be424
': Fix a bug that happens upon a race condition
parents
21915c4c
be3be424
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/src/com/android/inputmethod/latin/LatinIME.java
+1
-0
1 addition, 0 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
java/src/com/android/inputmethod/latin/utils/TextRange.java
+4
-0
4 additions, 0 deletions
java/src/com/android/inputmethod/latin/utils/TextRange.java
with
5 additions
and
0 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
+
1
−
0
View file @
2e107841
...
...
@@ -2746,6 +2746,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final
TextRange
range
=
mConnection
.
getWordRangeAtCursor
(
currentSettings
.
mWordSeparators
,
0
/* additionalPrecedingWordsCount */
);
if
(
null
==
range
)
return
;
// Happens if we don't have an input connection at all
if
(
range
.
length
()
<=
0
)
return
;
// Race condition. No text to resume on, so bail out.
// If for some strange reason (editor bug or so) we measure the text before the cursor as
// longer than what the entire text is supposed to be, the safe thing to do is bail out.
final
int
numberOfCharsInWordBeforeCursor
=
range
.
getNumberOfCharsInWordBeforeCursor
();
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/utils/TextRange.java
+
4
−
0
View file @
2e107841
...
...
@@ -40,6 +40,10 @@ public final class TextRange {
return
mWordAtCursorEndIndex
-
mCursorIndex
;
}
public
int
length
()
{
return
mWord
.
length
();
}
/**
* Gets the suggestion spans that are put squarely on the word, with the exact start
* and end of the span matching the boundaries of the word.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment