Skip to content

Commit 0a9940b

Browse files
authored
Improves performance (microsoft#158502)
1 parent 289c8fd commit 0a9940b

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -342,25 +342,25 @@ export class MergeEditor extends AbstractTextEditor<IMergeEditorViewState> {
342342
this._sessionDisposables.add(autorunWithStore((reader, store) => {
343343
const input1ViewZoneIds: string[] = [];
344344
const input2ViewZoneIds: string[] = [];
345-
for (const m of model.modifiedBaseRanges.read(reader)) {
346-
const max = Math.max(m.input1Range.lineCount, m.input2Range.lineCount, 1);
347-
348-
this.input1View.editor.changeViewZones(a => {
349-
input1ViewZoneIds.push(a.addZone({
350-
afterLineNumber: m.input1Range.endLineNumberExclusive - 1,
351-
heightInLines: max - m.input1Range.lineCount,
352-
domNode: $('div.diagonal-fill'),
353-
}));
354-
});
355-
356-
this.input2View.editor.changeViewZones(a => {
357-
input2ViewZoneIds.push(a.addZone({
358-
afterLineNumber: m.input2Range.endLineNumberExclusive - 1,
359-
heightInLines: max - m.input2Range.lineCount,
360-
domNode: $('div.diagonal-fill'),
361-
}));
345+
this.input1View.editor.changeViewZones(a1 => {
346+
this.input2View.editor.changeViewZones(a2 => {
347+
for (const m of model.modifiedBaseRanges.read(reader)) {
348+
const max = Math.max(m.input1Range.lineCount, m.input2Range.lineCount, 1);
349+
350+
input1ViewZoneIds.push(a1.addZone({
351+
afterLineNumber: m.input1Range.endLineNumberExclusive - 1,
352+
heightInLines: max - m.input1Range.lineCount,
353+
domNode: $('div.diagonal-fill'),
354+
}));
355+
356+
input2ViewZoneIds.push(a2.addZone({
357+
afterLineNumber: m.input2Range.endLineNumberExclusive - 1,
358+
heightInLines: max - m.input2Range.lineCount,
359+
domNode: $('div.diagonal-fill'),
360+
}));
361+
}
362362
});
363-
}
363+
});
364364

365365
store.add({
366366
dispose: () => {

0 commit comments

Comments
 (0)