mergeWith(right) {
    if (this.constructor === right.constructor && compareIDs(right.origin, this.lastId) && this.right === right && compareIDs(this.rightOrigin, right.rightOrigin) && this.id.client === right.id.client && this.id.clock + this.length === right.id.clock && this.deleted === right.deleted && this.redone === null && right.redone === null && this.content.constructor === right.content.constructor && this.content.mergeWith(right.content)) {
      const searchMarker =
      /** @type {AbstractType<any>} */
      this.parent._searchMarker;

      if (searchMarker) {
        searchMarker.forEach(marker => {
          if (marker.p === right) {
            // right is going to be "forgotten" so we need to update the marker
            marker.p = this; // adjust marker index

            if (!this.deleted && this.countable) {
              marker.index -= this.length;
            }
          }
        });
      }

      if (right.keep) {
        this.keep = true;
      }

      this.right = right.right;

      if (this.right !== null) {
        this.right.left = this;
      }

      this.length += right.length;
      return true;
    }

    return false;
  }
Try to merge two items

@param {Item} right
@return {boolean}