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
f68fe7a9
Commit
f68fe7a9
authored
12 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Don't forward phantom space state on stripper input
Bug: 6890540 Change-Id: I923b24e3bc17e7b923be4940ad739b58dca24a1f
parent
ca57f5ba
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
+6
-1
6 additions, 1 deletion
java/src/com/android/inputmethod/latin/LatinIME.java
tests/src/com/android/inputmethod/latin/InputLogicTests.java
+13
-0
13 additions, 0 deletions
tests/src/com/android/inputmethod/latin/InputLogicTests.java
with
19 additions
and
1 deletion
java/src/com/android/inputmethod/latin/LatinIME.java
+
6
−
1
View file @
f68fe7a9
...
...
@@ -1651,13 +1651,18 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if
(
swapWeakSpace
)
{
swapSwapperAndSpace
();
mSpaceState
=
SPACE_STATE_SWAP_PUNCTUATION
;
}
else
if
(
SPACE_STATE_PHANTOM
==
spaceState
)
{
}
else
if
(
SPACE_STATE_PHANTOM
==
spaceState
&&
!
mCurrentSettings
.
isWeakSpaceStripper
(
primaryCode
))
{
// If we are in phantom space state, and the user presses a separator, we want to
// stay in phantom space state so that the next keypress has a chance to add the
// space. For example, if I type "Good dat", pick "day" from the suggestion strip
// then insert a comma and go on to typing the next word, I want the space to be
// inserted automatically before the next word, the same way it is when I don't
// input the comma.
// The case is a little different if the separator is a space stripper. Such a
// separator does not normally need a space on the right (that's the difference
// between swappers and strippers), so we should not stay in phantom space state if
// the separator is a stripper. Hence the additional test above.
mSpaceState
=
SPACE_STATE_PHANTOM
;
}
...
...
This diff is collapsed.
Click to expand it.
tests/src/com/android/inputmethod/latin/InputLogicTests.java
+
13
−
0
View file @
f68fe7a9
...
...
@@ -216,6 +216,19 @@ public class InputLogicTests extends InputTestsBase {
assertEquals
(
"manual pick then separator"
,
EXPECTED_RESULT
,
mTextView
.
getText
().
toString
());
}
public
void
testManualPickThenStripperThenPick
()
{
final
String
WORD_TO_TYPE
=
"this"
;
final
String
STRIPPER
=
"\n"
;
final
String
EXPECTED_RESULT
=
"this\nthis"
;
type
(
WORD_TO_TYPE
);
pickSuggestionManually
(
0
,
WORD_TO_TYPE
);
type
(
STRIPPER
);
type
(
WORD_TO_TYPE
);
pickSuggestionManually
(
0
,
WORD_TO_TYPE
);
assertEquals
(
"manual pick then \\n then manual pick"
,
EXPECTED_RESULT
,
mTextView
.
getText
().
toString
());
}
public
void
testManualPickThenSpaceThenType
()
{
final
String
WORD1_TO_TYPE
=
"this"
;
final
String
WORD2_TO_TYPE
=
" is"
;
...
...
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