Skip to content

Commit d2c6b2c

Browse files
committed
onDidChangeMarker-event have no marker before or after, microsoft#96914
1 parent 83a62c8 commit d2c6b2c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/vs/editor/common/services/markerDecorationsServiceImpl.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ class MarkerDecorations extends Disposable {
4141
return super._register(t);
4242
}
4343

44-
public update(markers: IMarker[], newDecorations: IModelDeltaDecoration[]): void {
44+
public update(markers: IMarker[], newDecorations: IModelDeltaDecoration[]): boolean {
4545
const oldIds = keys(this._markersData);
4646
this._markersData.clear();
4747
const ids = this.model.deltaDecorations(oldIds, newDecorations);
4848
for (let index = 0; index < ids.length; index++) {
4949
this._markersData.set(ids[index], markers[index]);
5050
}
51+
return oldIds.length !== 0 || ids.length !== 0;
5152
}
5253

5354
getMarker(decoration: IModelDecoration): IMarker | undefined {
@@ -144,8 +145,9 @@ export class MarkerDecorationsService extends Disposable implements IMarkerDecor
144145
options: this._createDecorationOption(marker)
145146
};
146147
});
147-
markerDecorations.update(markers, newModelDecorations);
148-
this._onDidChangeMarker.fire(markerDecorations.model);
148+
if (markerDecorations.update(markers, newModelDecorations)) {
149+
this._onDidChangeMarker.fire(markerDecorations.model);
150+
}
149151
}
150152

151153
private _createDecorationRange(model: ITextModel, rawMarker: IMarker): Range {

0 commit comments

Comments
 (0)