diff --git a/src/app/panels/tab-proxy.js b/src/app/panels/tab-proxy.js index dad1234045..9abc6f3295 100644 --- a/src/app/panels/tab-proxy.js +++ b/src/app/panels/tab-proxy.js @@ -27,6 +27,10 @@ export class TabProxy { }) fileManager.event.register('currentFileChanged', (file) => { + if (this._handlers[file]) { + this._view.filetabs.activateTab(file) + return + } this.addTab(file, () => { this.fileManager.switchFile(file) this.event.emit('switchFile', file) @@ -89,11 +93,11 @@ export class TabProxy { renderTabsbar () { this._view.filetabs = yo`` - this._view.filetabs.addEventListener('tabClosed', (id) => { - if (this._handlers[id]) this._handlers[id].close() + this._view.filetabs.addEventListener('tabClosed', (event) => { + if (this._handlers[event.detail]) this._handlers[event.detail].close() }) - this._view.filetabs.addEventListener('tabActivated', (id) => { - if (this._handlers[id]) this._handlers[id].switchTo() + this._view.filetabs.addEventListener('tabActivated', (event) => { + if (this._handlers[event.detail]) this._handlers[event.detail].switchTo() }) this._view.filetabs.canAdd = false