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

Signed-off-by: Jonah Iden <[email protected]>
  • Loading branch information
jonah-iden committed Nov 8, 2024
1 parent c7a1f49 commit 3d6c4d1
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 3d6c4d1

Please sign in to comment.