mirror of
https://github.com/Microsoft/vscode
synced 2024-10-13 14:57:14 +00:00
parent
8ea66339e9
commit
bbd1d81645
|
@ -127,7 +127,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
|
|||
this.name = resources.basenameOrAuthority(this.resource);
|
||||
}
|
||||
|
||||
return this.decorateOrphanedFiles(this.name);
|
||||
return this.decorateLabel(this.name);
|
||||
}
|
||||
|
||||
@memoize
|
||||
|
@ -192,14 +192,17 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
|
|||
break;
|
||||
}
|
||||
|
||||
return this.decorateOrphanedFiles(title);
|
||||
return this.decorateLabel(title);
|
||||
}
|
||||
|
||||
private decorateOrphanedFiles(label: string): string {
|
||||
private decorateLabel(label: string): string {
|
||||
const model = this.textFileService.models.get(this.resource);
|
||||
if (model && model.hasState(ModelState.ORPHAN)) {
|
||||
return localize('orphanedFile', "{0} (deleted from disk)", label);
|
||||
}
|
||||
if (model && model.isReadonly) {
|
||||
return localize('readonlyFile', "{0} (read-only)", label);
|
||||
}
|
||||
|
||||
return label;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue