Skip to content

Commit

Permalink
Fix active notebook editor staying active as long as the editor is ac…
Browse files Browse the repository at this point in the history
…tive (#14419)

Signed-off-by: Jonah Iden <[email protected]>
  • Loading branch information
jonah-iden authored Nov 11, 2024
1 parent c028a03 commit 8664fac
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class EditorAndDocumentStateComputer implements Disposable {
}

let activeId: string | null = null;
const activeEditor = MonacoEditor.getCurrent(this.editorService);
const activeEditor = MonacoEditor.getCurrent(this.editorService) ?? this.cellEditorService.getActiveCell();

const editors = new Map<string, EditorSnapshot>();
for (const widget of this.editorService.all) {
Expand All @@ -340,6 +340,9 @@ class EditorAndDocumentStateComputer implements Disposable {
if (editor.getControl()?.getModel()) {
const editorSnapshot = new EditorSnapshot(editor);
editors.set(editorSnapshot.id, editorSnapshot);
if (activeEditor === editor) {
activeId = editorSnapshot.id;
}
}
};

Expand Down

0 comments on commit 8664fac

Please sign in to comment.