Skip to content

Commit

Permalink
Trigger change event onces in outline provider (#210576)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored Apr 17, 2024
1 parent ad220f4 commit debb347
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,13 @@ export class NotebookCellOutlineProvider {
}
}));

this._recomputeActive();
this._onDidChange.fire({});
const { changeEventTriggered } = this._recomputeActive();
if (!changeEventTriggered) {
this._onDidChange.fire({});
}
}

private _recomputeActive(): void {
private _recomputeActive(): { changeEventTriggered: boolean } {
let newActive: OutlineEntry | undefined;
const notebookEditorWidget = this._editor;

Expand Down Expand Up @@ -291,7 +293,10 @@ export class NotebookCellOutlineProvider {
) {
this._activeEntry = newActive;
this._onDidChange.fire({ affectOnlyActiveElement: true });
return { changeEventTriggered: true };
}

return { changeEventTriggered: false };
}

get isEmpty(): boolean {
Expand Down

0 comments on commit debb347

Please sign in to comment.