@@ -60,7 +60,8 @@ import { ITunnelService, extractLocalHostUriMetaDataForPortMapping } from 'vs/pl
6060import { IWorkbenchLayoutService , Parts } from 'vs/workbench/services/layout/browser/layoutService' ;
6161import { IHostService } from 'vs/workbench/services/host/browser/host' ;
6262import { IElectronEnvironmentService } from 'vs/workbench/services/electron/electron-browser/electronEnvironmentService' ;
63- import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService' ;
63+ import { IWorkingCopyService , WorkingCopyCapabilities } from 'vs/workbench/services/workingCopy/common/workingCopyService' ;
64+ import { AutoSaveMode , IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService' ;
6465
6566export class ElectronWindow extends Disposable {
6667
@@ -103,7 +104,8 @@ export class ElectronWindow extends Disposable {
103104 @ITunnelService private readonly tunnelService : ITunnelService ,
104105 @IWorkbenchLayoutService private readonly layoutService : IWorkbenchLayoutService ,
105106 @IElectronEnvironmentService private readonly electronEnvironmentService : IElectronEnvironmentService ,
106- @IWorkingCopyService private readonly workingCopyService : IWorkingCopyService
107+ @IWorkingCopyService private readonly workingCopyService : IWorkingCopyService ,
108+ @IFilesConfigurationService private readonly filesConfigurationService : IFilesConfigurationService
107109 ) {
108110 super ( ) ;
109111
@@ -267,6 +269,10 @@ export class ElectronWindow extends Disposable {
267269 if ( isMacintosh ) {
268270 this . _register ( this . workingCopyService . onDidChangeDirty ( workingCopy => {
269271 const gotDirty = workingCopy . isDirty ( ) ;
272+ if ( gotDirty && ! ! ( workingCopy . capabilities & WorkingCopyCapabilities . AutoSave ) && this . filesConfigurationService . getAutoSaveMode ( ) === AutoSaveMode . AFTER_SHORT_DELAY ) {
273+ return ; // do not indicate dirty of working copies that are auto saved after short delay
274+ }
275+
270276 if ( ( ! this . isDocumentedEdited && gotDirty ) || ( this . isDocumentedEdited && ! gotDirty ) ) {
271277 const hasDirtyFiles = this . workingCopyService . hasDirty ;
272278 this . isDocumentedEdited = hasDirtyFiles ;
0 commit comments