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 <cursoragent@cursor.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user