fix(addon-image): skip missing lines in viewportResize

viewportResize walks the full buffer when the terminal widens but
called line.getBg without checking that lines.get(row) returned a
line. During resize or trim gaps that could throw and abort tile
expansion for remaining rows.

Skip missing buffer lines with continue, consistent with render().

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Daniel Imms
2026-06-03 03:36:42 +00:00
committed by Cursor Agent
co-authored by Cursor
parent a0919b9004
commit a8632435a6
+3
View File
@@ -514,6 +514,9 @@ export class ImageStorage implements IDisposable {
const oldCol = this._viewportMetrics.cols - 1;
for (let row = 0; row < rows; ++row) {
const line = buffer.lines.get(row) as IBufferLineExt;
if (!line) {
continue;
}
if (line.getBg(oldCol) & BgFlags.HAS_EXTENDED) {
const e: IExtendedAttrsImage = line._extendedAttrs[oldCol] ?? EMPTY_ATTRS;
const imageId = e.imageId;