Skip to content
Snippets Groups Projects
Commit 2ae175b6 authored by Aleksandras Kostarevas's avatar Aleksandras Kostarevas
Browse files

Fix incorrect auto space check for empty field

parent 780ead13
No related branches found
No related tags found
No related merge requests found
......@@ -1115,6 +1115,9 @@ public final class InputLogic {
}
}
final boolean fieldEmptyBeforeText =
(mConnection.getCodePointBeforeCursor() == Constants.NOT_A_CODE);
sendKeyCodePoint(settingsValues, codePoint);
boolean codeShouldBeFollowedBySpace = false;
......@@ -1138,8 +1141,7 @@ public final class InputLogic {
// Do not automatically insert a space if there is no text preceding the cursor
// (e.g. if we are typing "!g", do not insert space after exclamation mark,
// and if we are typing ":)", do not insert space after colon)
codeShouldBeFollowedBySpace = codeShouldBeFollowedBySpace
&& (mConnection.getCodePointBeforeCursor() != Constants.NOT_A_CODE);
codeShouldBeFollowedBySpace = codeShouldBeFollowedBySpace && !fieldEmptyBeforeText;
if(autoInsertSpaces && codeShouldBeFollowedBySpace) {
insertOrSetPhantomSpace(settingsValues);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment