Commit bb23300c authored by bunsenstraat's avatar bunsenstraat Committed by filip mertens

Update fileManager.js

first discard the file, then call fileRemoved which causes the unselectCurrentFile to resave the file.
parent 6f0fd77b
...@@ -424,15 +424,14 @@ class FileManager extends Plugin { ...@@ -424,15 +424,14 @@ class FileManager extends Plugin {
} }
fileRemovedEvent (path) { 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')) { if (path === this._deps.config.get('currentFile')) {
this._deps.config.set('currentFile', '') this._deps.config.set('currentFile', '')
} }
this.editor.discard(path) this.editor.discard(path)
delete this.openedFiles[path] delete this.openedFiles[path]
// TODO: Only keep `this.emit` (issue#2210)
this.emit('fileRemoved', path)
this.events.emit('fileRemoved', path)
this.openFile() this.openFile()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment