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
4b5b46bb
Commit
4b5b46bb
authored
12 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Don't autocorrect after suggestion resuming
Bug: 6105732 Change-Id: I92e7a9c6d6eb648f747c3b396d7993479fd8478a
parent
3bb419ec
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/src/com/android/inputmethod/latin/Suggest.java
+1
-0
1 addition, 0 deletions
java/src/com/android/inputmethod/latin/Suggest.java
java/src/com/android/inputmethod/latin/WordComposer.java
+14
-0
14 additions, 0 deletions
java/src/com/android/inputmethod/latin/WordComposer.java
with
15 additions
and
0 deletions
java/src/com/android/inputmethod/latin/Suggest.java
+
1
−
0
View file @
4b5b46bb
...
...
@@ -385,6 +385,7 @@ public class Suggest implements Dictionary.WordCallback {
}
// Don't auto-correct words with multiple capital letter
autoCorrectionAvailable
&=
!
wordComposer
.
isMostlyCaps
();
autoCorrectionAvailable
&=
!
wordComposer
.
isResumed
();
if
(
allowsToBeAutoCorrected
&&
suggestionsList
.
size
()
>
1
&&
mAutoCorrectionThreshold
>
0
&&
Suggest
.
shouldBlockAutoCorrectionBySafetyNet
(
typedWord
,
suggestionsList
.
get
(
1
).
mWord
))
{
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/WordComposer.java
+
14
−
0
View file @
4b5b46bb
...
...
@@ -38,6 +38,7 @@ public class WordComposer {
private
int
[]
mYCoordinates
;
private
StringBuilder
mTypedWord
;
private
CharSequence
mAutoCorrection
;
private
boolean
mIsResumed
;
// Cache these values for performance
private
int
mCapsCount
;
...
...
@@ -57,6 +58,7 @@ public class WordComposer {
mYCoordinates
=
new
int
[
N
];
mAutoCorrection
=
null
;
mTrailingSingleQuotesCount
=
0
;
mIsResumed
=
false
;
refreshSize
();
}
...
...
@@ -73,6 +75,7 @@ public class WordComposer {
mIsFirstCharCapitalized
=
source
.
mIsFirstCharCapitalized
;
mAutoCapitalized
=
source
.
mAutoCapitalized
;
mTrailingSingleQuotesCount
=
source
.
mTrailingSingleQuotesCount
;
mIsResumed
=
source
.
mIsResumed
;
refreshSize
();
}
...
...
@@ -85,6 +88,7 @@ public class WordComposer {
mCapsCount
=
0
;
mIsFirstCharCapitalized
=
false
;
mTrailingSingleQuotesCount
=
0
;
mIsResumed
=
false
;
refreshSize
();
}
...
...
@@ -193,6 +197,7 @@ public class WordComposer {
int
codePoint
=
Character
.
codePointAt
(
word
,
i
);
addKeyInfo
(
codePoint
,
keyboard
);
}
mIsResumed
=
true
;
}
/**
...
...
@@ -299,6 +304,13 @@ public class WordComposer {
return
mAutoCorrection
;
}
/**
* @return whether we started composing this word by resuming suggestion on an existing string
*/
public
boolean
isResumed
()
{
return
mIsResumed
;
}
// `type' should be one of the LastComposedWord.COMMIT_TYPE_* constants above.
public
LastComposedWord
commitWord
(
final
int
type
,
final
String
committedWord
,
final
int
separatorCode
)
{
...
...
@@ -320,6 +332,7 @@ public class WordComposer {
mTypedWord
.
setLength
(
0
);
refreshSize
();
mAutoCorrection
=
null
;
mIsResumed
=
false
;
return
lastComposedWord
;
}
...
...
@@ -331,5 +344,6 @@ public class WordComposer {
mTypedWord
.
append
(
lastComposedWord
.
mTypedWord
);
refreshSize
();
mAutoCorrection
=
null
;
// This will be filled by the next call to updateSuggestion.
mIsResumed
=
true
;
}
}
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