boolean (int start, int end) { for (int caretOffset : caretOffsets) { if (start <= caretOffset && end >= caretOffset) return true; //skip prefix itself } if (end - start > matcher.getPrefix().length()) { final String word = chars.subSequence(start, end).toString(); if (matcher.isStartMatch(word)) { CompletionVariant v = new CompletionVariant(editor, word, start); if (end > primaryCaretOffset) { afterWords.add(v); } else { words.add(v); } } } return true; }