Skip to content

Commit

Permalink
custom-editors: fix auto save for binary custom-editors (#11599)
Browse files Browse the repository at this point in the history
The commit fixes the `auto save` behavior for binary custom-editors.

Signed-off-by: Safi Seid-Ahmad <[email protected]>
  • Loading branch information
safisa authored Sep 16, 2022
1 parent 9908bf1 commit 3a5172a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { RPCProtocol } from '../../../common/rpc-protocol';
import { HostedPluginSupport } from '../../../hosted/browser/hosted-plugin';
import { PluginCustomEditorRegistry } from './plugin-custom-editor-registry';
import { CustomEditorWidget } from './custom-editor-widget';
import { Emitter } from '@theia/core';
import { Emitter, UNTITLED_SCHEME } from '@theia/core';
import { UriComponents } from '../../../common/uri-components';
import { URI } from '@theia/core/shared/vscode-uri';
import TheiaURI from '@theia/core/lib/common/uri';
Expand Down Expand Up @@ -505,7 +505,7 @@ export class MainCustomEditorModel implements CustomEditorModel {
this.onDirtyChangedEmitter.fire();
}

if (this.autoSave !== 'off') {
if (this.autoSave !== 'off' && this.dirty && this.resource.scheme !== UNTITLED_SCHEME) {
const handle = window.setTimeout(() => {
this.save();
window.clearTimeout(handle);
Expand Down

0 comments on commit 3a5172a

Please sign in to comment.