@Override
  public @Nullable Caret addCaret(@NotNull LogicalPosition pos, boolean makePrimary) {
    EditorImpl.assertIsDispatchThread();
    CaretImpl caret = new CaretImpl(myEditor, this);
    caret.moveToLogicalPosition(pos, false, null, false, false);
    if (addCaret(caret, makePrimary)) {
      return caret;
    }
    Disposer.dispose(caret);
    return null;
  }
@Override
  public @Nullable Caret addCaret(@NotNull LogicalPosition pos, boolean makePrimary)