TextMateAutoClosingPair (char closingChar, @Nullable TextMateScope currentSelector) { if (!TextMateService.getInstance().getPreferenceRegistry().isPossibleRightSmartTypingBrace(closingChar)) { return null; } Set<TextMateAutoClosingPair> pairs = getSmartTypingPairs(currentSelector); for (TextMateAutoClosingPair pair : pairs) { if (pair.getRight().length() == 1 && pair.getRight().charAt(0) == closingChar) { return pair; } } return null; }