void (@NotNull SelectionEvent e) { alarm.cancelAllRequests(); Editor editor = e.getEditor(); if (editor.getProject() != project) { return; } highlightSelection(project, editor); TextRange oldRange = e.getOldRange(); TextRange newRange = e.getNewRange(); if (oldRange != null && newRange != null && oldRange.isEmpty() == newRange.isEmpty()) { // Don't update braces in case of active/absent selection. return; } updateHighlighted(project, editor, alarm); }