From f98941119d1a699d4e1d8182212db47e47b8b021 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 1 Oct 2018 12:13:54 +0200 Subject: [PATCH] add remove tabs of provider --- src/app/files/fileManager.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 46755b2de3..c37f3f30b9 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -95,12 +95,21 @@ class FileManager { return path ? path[1] : null } + removeTabsOf (provider) { + for (var tab in this.tabbedFiles) { + if (this.fileProviderOf(tab).type === provider.type) { + this.fileRemovedEvent(tab) + } + } + } + fileRemovedEvent (path) { var self = this + if (!this.tabbedFiles[path]) return if (path === self._deps.config.get('currentFile')) { self._deps.config.set('currentFile', '') } - self._deps.editor.discardCurrentSession() + self._deps.editor.discard(path) delete this.tabbedFiles[path] this.refreshTabs() this.switchFile()