From c15ae84f2a736e285dd2a9e19eeec8d7c2642155 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 20 Jan 2021 20:04:20 +0100 Subject: [PATCH] Update fileManager.js first discard the file, then call fileRemoved which causes the unselectCurrentFile to resave the file. --- apps/remix-ide/src/app/files/fileManager.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide/src/app/files/fileManager.js b/apps/remix-ide/src/app/files/fileManager.js index f46d76dd36..af188cd1bf 100644 --- a/apps/remix-ide/src/app/files/fileManager.js +++ b/apps/remix-ide/src/app/files/fileManager.js @@ -424,15 +424,14 @@ class FileManager extends Plugin { } fileRemovedEvent (path) { - // TODO: Only keep `this.emit` (issue#2210) - this.emit('fileRemoved', path) - this.events.emit('fileRemoved', path) - if (!this.openedFiles[path]) return if (path === this._deps.config.get('currentFile')) { this._deps.config.set('currentFile', '') } this.editor.discard(path) delete this.openedFiles[path] + // TODO: Only keep `this.emit` (issue#2210) + this.emit('fileRemoved', path) + this.events.emit('fileRemoved', path) this.openFile() }