Skip to content

Commit c4ab63f

Browse files
committed
treat soon-to-be-autosaved as saving
1 parent 4b2f5dc commit c4ab63f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/vs/workbench/contrib/customEditor/browser/customEditorInput.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { EditorInput } from 'vs/workbench/common/editor/editorInput';
2222
import { ICustomEditorModel, ICustomEditorService } from 'vs/workbench/contrib/customEditor/common/customEditor';
2323
import { IOverlayWebview, IWebviewService } from 'vs/workbench/contrib/webview/browser/webview';
2424
import { IWebviewWorkbenchService, LazilyResolvedWebviewEditorInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
25-
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
25+
import { AutoSaveMode, IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
2626
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
2727

2828
interface CustomEditorInputInitInfo {
@@ -302,6 +302,14 @@ export class CustomEditorInput extends LazilyResolvedWebviewEditorInput {
302302
return (await this.rename(groupId, target))?.editor;
303303
}
304304

305+
override isSaving(): boolean {
306+
if (this.isDirty() && !this.hasCapability(EditorInputCapabilities.Untitled) && this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) {
307+
return true; // will be saved soon
308+
}
309+
310+
return super.isSaving();
311+
}
312+
305313
public override async revert(group: GroupIdentifier, options?: IRevertOptions): Promise<void> {
306314
if (this._modelRef) {
307315
return this._modelRef.object.revert(options);

0 commit comments

Comments
 (0)