Skip to content

Commit

Permalink
fix onDidChangeActiveNotebookEditorEmitter to fire correctly when edi…
Browse files Browse the repository at this point in the history
…tor changed (#14321)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
  • Loading branch information
jonah-iden authored Oct 17, 2024
1 parent 54919bf commit 78ce064
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/plugin-ext/src/plugin/notebook/notebooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ export class NotebooksExtImpl implements NotebooksExt {
if (delta.newActiveEditor === null) {
// clear active notebook as current active editor is non-notebook editor
this.activeNotebookEditor = undefined;
this.onDidChangeActiveNotebookEditorEmitter.fire(undefined);
} else if (delta.newActiveEditor) {
const activeEditor = this.editors.get(delta.newActiveEditor);
if (!activeEditor) {
Expand All @@ -341,8 +342,6 @@ export class NotebooksExtImpl implements NotebooksExt {
newActiveEditor: null
});
}
}
if (delta.newActiveEditor !== undefined && delta.newActiveEditor !== this.activeNotebookEditor?.id) {
this.onDidChangeActiveNotebookEditorEmitter.fire(this.activeNotebookEditor?.apiEditor);
}
}
Expand Down

0 comments on commit 78ce064

Please sign in to comment.