From b5e0cdb20c49c3b8f52b39933ac896243f9a2a43 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Mon, 1 Jun 2026 20:03:53 -0700 Subject: [PATCH] fix(addon-image): scan new columns on viewport width increase viewportResize() should check whether cells in newly exposed columns (oldCol + 1 through cols - 1) already have content before expanding image tiles to the right. The loop used `rightCol > metrics.cols`, which is false when widening (rightCol starts at oldCol + 1), so the loop never ran, hasData stayed false, and tiles could overwrite cells that already held text. Use `rightCol < metrics.cols` so the emptiness check runs over the intended column range. Co-authored-by: Cursor --- addons/addon-image/src/ImageStorage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/addon-image/src/ImageStorage.ts b/addons/addon-image/src/ImageStorage.ts index 75851343c..0b72fb83f 100644 --- a/addons/addon-image/src/ImageStorage.ts +++ b/addons/addon-image/src/ImageStorage.ts @@ -531,7 +531,7 @@ export class ImageStorage implements IDisposable { } // expand only if right side is empty (nothing got wrapped from below) let hasData = false; - for (let rightCol = oldCol + 1; rightCol > metrics.cols; ++rightCol) { + for (let rightCol = oldCol + 1; rightCol < metrics.cols; ++rightCol) { if (line._data[rightCol * Cell.SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK) { hasData = true; break;