提交 d517e3e3 编写于 作者: B Benjamin Pasero

fix #13363

上级 dbea32ff
......@@ -65,8 +65,9 @@ export class TextFileEditorModelManager implements ITextFileEditorModelManager {
private registerListeners(): void {
// Editors changing
// Editors changing/closing
this.toUnbind.push(this.editorGroupService.onEditorsChanged(() => this.onEditorsChanged()));
this.toUnbind.push(this.editorGroupService.getStacksModel().onEditorClosed(() => this.onEditorClosed()));
// File changes
this.toUnbind.push(this.eventService.addListener2('files.internal:fileChanged', (e: LocalFileChangeEvent) => this.onLocalFileChange(e)));
......@@ -80,6 +81,10 @@ export class TextFileEditorModelManager implements ITextFileEditorModelManager {
this.disposeUnusedModels();
}
private onEditorClosed(): void {
this.disposeUnusedModels();
}
private disposeModelIfPossible(resource: URI): void {
const model = this.get(resource);
if (this.canDispose(model)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册