boolean (HighlighterIterator iterator, int offset) { final IElementType tokenType = iterator.getTokenType(); if (getClosingQuotesTokens().contains(tokenType)) { int start = iterator.getStart(); int end = iterator.getEnd(); if (end - start >= 1 && offset == end - 1) { Document doc = iterator.getDocument(); if (doc == null) return false; CharSequence chars = doc.getCharsSequence(); if (chars.length() > offset + 1) { char ch = chars.charAt(offset + 1); if (Arrays.binarySearch(ourAutoClosingChars, ch) < 0) { return false; } } return true; } } return false; }