Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fire onDidChangeViewState for interactive window #7596

Merged
merged 1 commit into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/7249.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Code cell submissions should go to active window in 'multiple' mode.
17 changes: 10 additions & 7 deletions src/client/datascience/interactive-window/interactiveWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {
TextEditorRevealType,
ViewColumn,
NotebookEditor,
Disposable
Disposable,
window
} from 'vscode';
import { IPythonExtensionChecker } from '../../api/types';
import {
Expand Down Expand Up @@ -55,8 +56,7 @@ import {
IInteractiveWindowInfo,
IInteractiveWindowLoadable,
IJupyterDebugger,
INotebookExporter,
WebViewViewChangeEventArgs
INotebookExporter
} from '../types';
import { createInteractiveIdentity, getInteractiveWindowTitle } from './identity';
import { generateMarkdownFromCodeLines } from '../../../datascience-ui/common';
Expand Down Expand Up @@ -203,6 +203,13 @@ export class InteractiveWindow implements IInteractiveWindowLoadable {
}
this._notebookEditor = notebookEditor;
this.notebookDocument = notebookEditor.document;
this.internalDisposables.push(
window.onDidChangeActiveNotebookEditor((e) => {
if (e === this._notebookEditor) {
this._onDidChangeViewState.fire();
}
})
);
this.listenForControllerSelection(notebookEditor.document);
this.initializeRendererCommunication();
return notebookEditor;
Expand Down Expand Up @@ -538,10 +545,6 @@ export class InteractiveWindow implements IInteractiveWindowLoadable {
return undefined;
}

protected async onViewStateChanged(_args: WebViewViewChangeEventArgs) {
this._onDidChangeViewState.fire();
}

protected get notebookMetadata(): Readonly<nbformat.INotebookMetadata> | undefined {
return undefined;
}
Expand Down