提交 06e1057c 编写于 作者: R Rob Lourens

Fix notebook showing itself at the wrong time when editor config changes

Fix #99999
上级 79b6605b
......@@ -97,6 +97,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
private readonly _onDidFocusWidget = this._register(new Emitter<void>());
public get onDidFocus(): Event<any> { return this._onDidFocusWidget.event; }
private _cellContextKeyManager: CellContextKeyManager | null = null;
private _isVisible = false;
get isDisposed() {
return this._isDisposed;
......@@ -120,7 +121,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration('editor.scrollBeyondLastLine')) {
this.scrollBeyondLastLine = this.configurationService.getValue<boolean>('editor.scrollBeyondLastLine');
if (this.dimension) {
if (this.dimension && this._isVisible) {
this.layout(this.dimension);
}
}
......@@ -235,6 +236,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
this.generateFontInfo();
this.editorFocus = NOTEBOOK_EDITOR_FOCUSED.bindTo(this.contextKeyService);
this.editorFocus.set(true);
this._isVisible = true;
this.outputFocus = NOTEBOOK_OUTPUT_FOCUSED.bindTo(this.contextKeyService);
this.editorEditable = NOTEBOOK_EDITOR_EDITABLE.bindTo(this.contextKeyService);
this.editorEditable.set(true);
......@@ -370,6 +372,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
}
onWillHide() {
this._isVisible = false;
this.editorFocus?.set(false);
this.overlayContainer.style.visibility = 'hidden';
this.overlayContainer.style.left = '-50000px';
......@@ -379,8 +382,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
return this.webview?.webview;
}
focus() {
this._isVisible = true;
this.editorFocus?.set(true);
this.list?.domFocus();
this._onDidFocusEditorWidget.fire();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册