Skip to content

Commit

Permalink
Improves code.
Browse files Browse the repository at this point in the history
  • Loading branch information
hediet committed Apr 19, 2022
1 parent bc5bfa0 commit 8edff91
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class GhostTextWidget extends Disposable {
if (!this.editor.hasModel() || !ghostText || this.disposed) {
this.partsWidget.clear();
this.additionalLinesWidget.clear();
this.replacementDecoration.setDecorations([]);
this.replacementDecoration.clear();
return;
}

Expand Down Expand Up @@ -213,8 +213,14 @@ class DisposableDecorations {
public setDecorations(decorations: IModelDeltaDecoration[]): void {
this.decorationIds = this.editor.deltaDecorations(this.decorationIds, decorations);
}
public dispose(): void {

public clear() {
this.editor.deltaDecorations(this.decorationIds, []);
this.decorationIds = [];
}

public dispose(): void {
this.clear();
}
}

Expand Down

0 comments on commit 8edff91

Please sign in to comment.