Files
t3code/apps
Cursor Agent e72d364ef8 Fix: suppress didSet observer during incremental token merge
In mergeTokensByRowId, each tokensByRowId[rowId] = tokens assignment
triggered the didSet observer (Swift Dictionary is a value type), causing
tokenAttributedStringsByRowId.removeAll(), clampHorizontalOffsets(), and
setNeedsDisplayForVisibleBounds() to fire N times — once per patched row.

This defeated the incremental cache invalidation the method intended and
multiplied layout work for large token patches.

Add a _suppressTokensByRowIdDidSet flag so the didSet observer is skipped
during the merge loop. The method already performs its own targeted cache
invalidation (removeValue per row) and calls clampHorizontalOffsets() and
setNeedsDisplayForVisibleBounds() once at the end.
2026-05-01 05:37:54 +00:00
..
2026-04-23 18:05:15 +00:00