aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-19 03:52:29 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-12-19 03:52:29 -0800
commit447f335f277c10a7e1d4f54f74ea25247750705c (patch)
tree96a88ec9e156c66d2c960cafa20daff6a94182ee
parentf84fb3d653052438e3a18513d9bf654e2e2b20ec (diff)
parentcdd8a1a69d0fdbf844ab390e22872e2b32f1d664 (diff)
downloadlatinime-447f335f277c10a7e1d4f54f74ea25247750705c.tar.gz
latinime-447f335f277c10a7e1d4f54f74ea25247750705c.tar.xz
latinime-447f335f277c10a7e1d4f54f74ea25247750705c.zip
am cdd8a1a6: [IL13] Inline restartSuggestionsOnWordBeforeCursor
* commit 'cdd8a1a69d0fdbf844ab390e22872e2b32f1d664': [IL13] Inline restartSuggestionsOnWordBeforeCursor
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java32
1 files changed, 10 insertions, 22 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index f44ee8b9a..2f9221071 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -823,10 +823,17 @@ public final class InputLogic {
final CharSequence word = mConnection.getWordBeforeCursorIfAtEndOfWord(settingsValues);
if (null != word) {
final String wordString = word.toString();
- restartSuggestionsOnWordBeforeCursor(settingsValues, wordString, keyboardSwitcher,
- handler);
+ mWordComposer.setComposingWord(word,
+ // Previous word is the 2nd word before cursor because we are restarting on the
+ // 1st word before cursor.
+ getNthPreviousWordForSuggestion(settingsValues, 2 /* nthPreviousWord */),
+ keyboardSwitcher.getKeyboard());
+ final int length = word.length();
+ mConnection.deleteSurroundingText(length, 0);
+ mConnection.setComposingText(word, 1);
+ handler.postUpdateSuggestionStrip();
// TODO: Handle the case where the user manually moves the cursor and then backs up over
- // a separator. In that case, the current log unit should not be uncommitted.
+ // a separator. In that case, the current log unit should not be uncommitted.
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
ResearchLogger.getInstance().uncommitCurrentLogUnit(wordString,
true /* dumpCurrentLogUnit */);
@@ -835,25 +842,6 @@ public final class InputLogic {
}
/**
- * Restart suggestions on the word passed as an argument, assuming it is before the cursor.
- * @param settingsValues the current settings values.
- */
- private void restartSuggestionsOnWordBeforeCursor(final SettingsValues settingsValues,
- final String word,
- // TODO: remove these two arguments
- final KeyboardSwitcher keyboardSwitcher, final LatinIME.UIHandler handler) {
- mWordComposer.setComposingWord(word,
- // Previous word is the 2nd word before cursor because we are restarting on the
- // 1st word before cursor.
- getNthPreviousWordForSuggestion(settingsValues, 2 /* nthPreviousWord */),
- keyboardSwitcher.getKeyboard());
- final int length = word.length();
- mConnection.deleteSurroundingText(length, 0);
- mConnection.setComposingText(word, 1);
- handler.postUpdateSuggestionStrip();
- }
-
- /**
* Reverts a previous commit with auto-correction.
*
* This is triggered upon pressing backspace just after a commit with auto-correction.