Skip to content

Commit

Permalink
add remove tabs of provider
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Oct 1, 2018
1 parent 570c2d0 commit f989411
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/app/files/fileManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f989411

Please sign in to comment.