Handle dirty state

This commit is contained in:
rebornix
2024-03-11 09:09:05 -07:00
parent 47327c9af0
commit 2010576297
2 changed files with 8 additions and 0 deletions
@@ -152,6 +152,11 @@ export class CustomEditorInput extends LazilyResolvedWebviewEditorInput {
if (this.resource.scheme === Schemas.untitled) {
capabilities |= EditorInputCapabilities.Untitled;
capabilities |= EditorInputCapabilities.AuxWindowUnsupported;
}
if (this.isDirty()) {
capabilities |= EditorInputCapabilities.AuxWindowUnsupported;
}
return capabilities;
@@ -123,6 +123,9 @@ export class OverlayWebview extends Disposable implements IOverlayWebview {
if (this._windowId !== targetWindow.vscodeWindowId) {
// moving to a new window
this.release(oldOwner);
// since we are moving to a new window, we need to dispose the webview and recreate
this._webview.clear();
this._webviewEvents.clear();
this._container?.domNode.remove();
this._container = undefined;
}