editors - tweak readonly usage

This commit is contained in:
Benjamin Pasero
2019-11-18 17:08:55 +01:00
parent dcf4572abd
commit 8efa538d7d
3 changed files with 16 additions and 17 deletions

View File

@@ -545,7 +545,11 @@ export abstract class TextEditorInput extends EditorInput {
return this.resource;
}
save(groupId: GroupIdentifier, options?: ITextFileSaveOptions): Promise<boolean> {
async save(groupId: GroupIdentifier, options?: ITextFileSaveOptions): Promise<boolean> {
if (this.isReadonly()) {
return false; // return early if editor is readonly
}
return this.textFileService.save(this.resource, options);
}