@Override
    @RequiresEdt
    public void caretAdded(@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 = editor.getCaretModel().getPrimaryCaret();

      if (addedCaret != currentPrimaryCaret) {
        // The added caret hasn't become primary, so we're not interested in its position
        return;
      }

      primaryCaretPositionPossiblyChanged(currentPrimaryCaret);
    }
@Override
    @RequiresEdt
    public void caretAdded(@NotNull CaretEvent event)