aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-05-30 11:40:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-30 11:40:56 +0000
commit83d2bc656fc127df4f4b92ce3ca03121200d7cf2 (patch)
tree996cd088e5287a87d0cb7439d02e2cd3a3992997 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
parent9c45e178c723c834f4f7e73c39e74eb00ffafa98 (diff)
parent8f71fab2ed619e34222a172a5004d7f91b4520a6 (diff)
downloadlatinime-83d2bc656fc127df4f4b92ce3ca03121200d7cf2.tar.gz
latinime-83d2bc656fc127df4f4b92ce3ca03121200d7cf2.tar.xz
latinime-83d2bc656fc127df4f4b92ce3ca03121200d7cf2.zip
Merge "Make prevWord = null if the next word starts from a connector."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index d4833f5fc..f36b42a40 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -704,11 +704,10 @@ public final class InputLogic {
(!mConnection.isCursorTouchingWord(settingsValues.mSpacingAndPunctuations)
|| !settingsValues.mSpacingAndPunctuations.mCurrentLanguageHasSpaces)) {
// Reset entirely the composing state anyway, then start composing a new word unless
- // the character is a single quote or a dash. The idea here is, single quote and dash
- // are not separators and they should be treated as normal characters, except in the
- // first position where they should not start composing a word.
- isComposingWord = (Constants.CODE_SINGLE_QUOTE != codePoint
- && Constants.CODE_DASH != codePoint);
+ // the character is a word connector. The idea here is, word connectors are not
+ // separators and they should be treated as normal characters, except in the first
+ // position where they should not start composing a word.
+ isComposingWord = !settingsValues.mSpacingAndPunctuations.isWordConnector(codePoint);
// Here we don't need to reset the last composed word. It will be reset
// when we commit this one, if we ever do; if on the other hand we backspace
// it entirely and resume suggestions on the previous word, we'd like to still
@@ -719,12 +718,15 @@ public final class InputLogic {
mWordComposer.processEvent(inputTransaction.mEvent);
// If it's the first letter, make note of auto-caps state
if (mWordComposer.isSingleLetter()) {
- // We pass 1 to getPreviousWordForSuggestion because we were not composing a word
- // yet, so the word we want is the 1st word before the cursor.
+ // We pass 2 to getPreviousWordForSuggestion when the previous code point is a word
+ // connector. Otherwise, we pass 1 because we were not composing a word yet, so the
+ // word we want is the 1st word before the cursor.
mWordComposer.setCapitalizedModeAndPreviousWordAtStartComposingTime(
inputTransaction.mShiftState,
getPrevWordsInfoFromNthPreviousWordForSuggestion(
- settingsValues.mSpacingAndPunctuations, 1 /* nthPreviousWord */));
+ settingsValues.mSpacingAndPunctuations,
+ settingsValues.mSpacingAndPunctuations.isWordConnector(
+ mConnection.getCodePointBeforeCursor()) ? 2 : 1));
}
mConnection.setComposingText(getTextWithUnderline(
mWordComposer.getTypedWord()), 1);