From c847d9215f4f21e7c19a3de14514d6985a7dcd4c Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Tue, 24 Mar 2026 18:16:58 +0100 Subject: [PATCH] [applyDelta] fix skipping over uncountables --- src/ytype.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ytype.js b/src/ytype.js index 52485272..720bf3d9 100644 --- a/src/ytype.js +++ b/src/ytype.js @@ -1047,7 +1047,7 @@ export class YType { deleteText(transaction, currPos, op.delete) } else if (delta.$modifyOp.check(op)) { let item = currPos.right - while (item?.deleted && !item.countable) { item = item.next } + while (item != null && (item.deleted || !item.countable)) { item = item.next } if (item == null || item.content.constructor !== ContentType) { error.unexpectedCase() } /** @type {ContentType} */ (item.content).type.applyDelta(op.value) currPos.formatText(transaction, /** @type {any} */ (this), 1, op.format || {})