Skip to content

Commit fd61554

Browse files
committed
fix: don't destory the dummty decoration
1 parent 473d82c commit fd61554

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

lib/decoration.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ export default class Decoration {
8888
return
8989
}
9090

91-
this.markerDestroyDisposable.dispose()
92-
this.markerDestroyDisposable = null
91+
this.markerDestroyDisposable?.dispose?.()
9392
this.destroyed = true
9493
this.emitter.emit("did-destroy")
9594
this.emitter.dispose()

lib/minimap.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ const disposedDisposable = new Disposable()
1212
disposedDisposable.dispose()
1313
const markerMock = {
1414
onDidDestroy: () => disposedDisposable,
15-
getScreenRange: () => ({}),
15+
getScreenRange: () => new Range(),
1616
}
17-
const destoryedDecoration = new Decoration(markerMock, null, {})
18-
destoryedDecoration.destroy()
17+
const dummyDecoration = new Decoration(markerMock, null, {})
1918

2019
/**
2120
* The Minimap class is the underlying model of a <MinimapElement>.
@@ -1148,16 +1147,16 @@ export default class Minimap {
11481147
return this.getDecorationManagement()?.onDidUpdateDecoration(...args) ?? disposedDisposable
11491148
}
11501149
decorationForId(...args) {
1151-
return this.getDecorationManagement()?.decorationForId(...args) ?? destoryedDecoration
1150+
return this.getDecorationManagement()?.decorationForId(...args) ?? dummyDecoration
11521151
}
11531152
decorationsForScreenRowRange(...args) {
1154-
return this.getDecorationManagement()?.decorationsForScreenRowRange(...args) ?? destoryedDecoration
1153+
return this.getDecorationManagement()?.decorationsForScreenRowRange(...args) ?? dummyDecoration
11551154
}
11561155
decorationsByTypeThenRows() {
1157-
return this.getDecorationManagement()?.decorationsByTypeThenRows() ?? destoryedDecoration
1156+
return this.getDecorationManagement()?.decorationsByTypeThenRows() ?? dummyDecoration
11581157
}
11591158
decorateMarker(...args) {
1160-
return this.getDecorationManagement()?.decorateMarker(...args) ?? destoryedDecoration
1159+
return this.getDecorationManagement()?.decorateMarker(...args) ?? dummyDecoration
11611160
}
11621161
removeDecoration(...args) {
11631162
return this.getDecorationManagement()?.removeDecoration(...args)

0 commit comments

Comments
 (0)