提交 e64364ff 编写于 作者: R rebornix

webview hijacks the focus for undo/redo

上级 5137025a
......@@ -198,6 +198,7 @@ export interface INotebookEditor extends IEditor {
focus(): void;
hasFocus(): boolean;
hasWebviewFocus(): boolean;
hasOutputTextSelection(): boolean;
......
......@@ -273,6 +273,10 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
return this._editorFocus?.get() || false;
}
hasWebviewFocus() {
return this._webiewFocused;
}
hasOutputTextSelection() {
if (!this.hasFocus()) {
return false;
......
......@@ -18,6 +18,10 @@ function getFocusedElectronBasedWebviewDelegate(accessor: ServicesAccessor): Ele
return;
}
if (!editor?.hasWebviewFocus()) {
return;
}
const webview = editor?.getInnerWebview();
if (webview && webview instanceof ElectronWebviewBasedWebview) {
return webview;
......
......@@ -82,6 +82,10 @@ export class TestNotebookEditor implements INotebookEditor {
return true;
}
hasWebviewFocus() {
return false;
}
hasOutputTextSelection() {
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册