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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user