boolean (int caretOffset, CharSequence text) { if (caretOffset == 0) return false; char charBefore = text.charAt(caretOffset - 1); for (char c : NO_SPACE_AFTER) { if (c == charBefore) { return false; } } return true; }