void (@NotNull CaretEvent event) { // Adding a caret may cause a change of the primary caret instance if (isInsideBulkUpdate()) { return; } final Caret addedCaret = event.getCaret(); final Caret currentPrimaryCaret = myEditor.getCaretModel().getPrimaryCaret(); if (addedCaret != currentPrimaryCaret) { // The added caret hasn't become primary, so we're not interested in its position return; } primaryCaretPositionPossiblyChanged(currentPrimaryCaret); }