Skip to content

Commit

Permalink
files - make sure to wire in model listener if already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Feb 19, 2020
1 parent 9fdb42c commit 071fe72
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,20 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi
) {
super(resource, editorService, editorGroupService, textFileService, labelService, fileService, filesConfigurationService);

this.model = this.textFileService.files.get(resource);

if (preferredEncoding) {
this.setPreferredEncoding(preferredEncoding);
}

if (preferredMode) {
this.setPreferredMode(preferredMode);
}

// If a file model already exists, make sure to wire it in
if (this.model) {
this.registerModelListeners(this.model);
}
}

protected registerListeners(): void {
Expand Down

0 comments on commit 071fe72

Please sign in to comment.