Remove iterators from IDecorationService

They're too low performance for typical use cases

Fixes #4079
This commit is contained in:
Daniel Imms
2022-08-27 20:50:16 -07:00
parent 5e3f63e876
commit 0727741ca1
6 changed files with 13 additions and 24 deletions
@@ -204,9 +204,9 @@ export class DomRendererRowFactory {
let bgOverride: IColor | undefined;
let fgOverride: IColor | undefined;
let isTop = false;
for (const d of this._decorationService.getDecorationsAtCell(x, row)) {
this._decorationService.forEachDecorationAtCell(x, row, undefined, d => {
if (d.options.layer !== 'top' && isTop) {
continue;
return;
}
if (d.backgroundColorRGB) {
bgColorMode = Attributes.CM_RGB;
@@ -219,7 +219,7 @@ export class DomRendererRowFactory {
fgOverride = d.foregroundColorRGB;
}
isTop = d.options.layer === 'top';
}
});
// Apply selection foreground if applicable
const isInSelection = this._isCellInSelection(x, row);