Merge pull request #188505 from microsoft/revert-187304-aamunger/dirtyCustomEditors

Revert "treat soon-to-be-autosaved as saving"
This commit is contained in:
Aaron Munger 2023-07-21 08:27:09 -07:00 committed by GitHub
commit b358b35c2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,7 +22,7 @@ import { EditorInput } from 'vs/workbench/common/editor/editorInput';
import { ICustomEditorModel, ICustomEditorService } from 'vs/workbench/contrib/customEditor/common/customEditor';
import { IOverlayWebview, IWebviewService } from 'vs/workbench/contrib/webview/browser/webview';
import { IWebviewWorkbenchService, LazilyResolvedWebviewEditorInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
import { AutoSaveMode, IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
interface CustomEditorInputInitInfo {
@ -302,14 +302,6 @@ export class CustomEditorInput extends LazilyResolvedWebviewEditorInput {
return (await this.rename(groupId, target))?.editor;
}
override isSaving(): boolean {
if (this.isDirty() && !this.hasCapability(EditorInputCapabilities.Untitled) && this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) {
return true; // will be saved soon
}
return super.isSaving();
}
public override async revert(group: GroupIdentifier, options?: IRevertOptions): Promise<void> {
if (this._modelRef) {
return this._modelRef.object.revert(options);