boolean (@NotNull Editor newEditor, @NotNull CodeInsightSettings codeInsightSettings) { if (!codeInsightSettings.HIGHLIGHT_BRACES) return false; if (newEditor.getSelectionModel().hasSelection()) return false; if (newEditor.getSoftWrapModel().isInsideOrBeforeSoftWrap(newEditor.getCaretModel().getVisualPosition())) return false; TemplateState state = TemplateManagerImpl.getTemplateState(newEditor); return state == null || state.isFinished(); }