Fix a bug where a space would not be inserted before a gesture

Bug: 8583675
Change-Id: I14924fef5663f48481994c02c56be45f9f85be65
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 56b1c78..db51131 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1540,7 +1540,8 @@
             }
         } else {
             final int codePointBeforeCursor = mConnection.getCodePointBeforeCursor();
-            if (mSettings.getCurrent().isUsuallyFollowedBySpace(codePointBeforeCursor)) {
+            if (Character.isLetter(codePointBeforeCursor)
+                    || mSettings.getCurrent().isUsuallyFollowedBySpace(codePointBeforeCursor)) {
                 mSpaceState = SPACE_STATE_PHANTOM;
             }
         }