Skip to content

Commit 2ae175b

Browse files
committed
Fix incorrect auto space check for empty field
1 parent 780ead1 commit 2ae175b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

java/src/org/futo/inputmethod/latin/inputlogic/InputLogic.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,9 @@ private void handleSeparatorEvent(final Event event, final InputTransaction inpu
11151115
}
11161116
}
11171117

1118+
final boolean fieldEmptyBeforeText =
1119+
(mConnection.getCodePointBeforeCursor() == Constants.NOT_A_CODE);
1120+
11181121
sendKeyCodePoint(settingsValues, codePoint);
11191122

11201123
boolean codeShouldBeFollowedBySpace = false;
@@ -1138,8 +1141,7 @@ private void handleSeparatorEvent(final Event event, final InputTransaction inpu
11381141
// Do not automatically insert a space if there is no text preceding the cursor
11391142
// (e.g. if we are typing "!g", do not insert space after exclamation mark,
11401143
// and if we are typing ":)", do not insert space after colon)
1141-
codeShouldBeFollowedBySpace = codeShouldBeFollowedBySpace
1142-
&& (mConnection.getCodePointBeforeCursor() != Constants.NOT_A_CODE);
1144+
codeShouldBeFollowedBySpace = codeShouldBeFollowedBySpace && !fieldEmptyBeforeText;
11431145

11441146
if(autoInsertSpaces && codeShouldBeFollowedBySpace) {
11451147
insertOrSetPhantomSpace(settingsValues);

0 commit comments

Comments
 (0)