diff --git a/src/common/services/DecorationService.ts b/src/common/services/DecorationService.ts index ea9b7fb14..49e85729d 100644 --- a/src/common/services/DecorationService.ts +++ b/src/common/services/DecorationService.ts @@ -214,7 +214,7 @@ export class DecorationLineCache extends Disposable { } private _handleBufferLinesTrim(amount: number): void { - if (amount <= 0) { + if (amount <= 0 || !this._decorationsByLine.size) { return; } const newMap = new Map();