Maintain an active pane container on the workspace

This will be used by many commands that previously only interacted with
the center of the workspace.
This commit is contained in:
Nathan Sobo
2017-04-06 15:30:01 -06:00
committed by Max Brunsfeld
parent f1e30fe7cf
commit 646047f563
5 changed files with 207 additions and 22 deletions

View File

@@ -3,11 +3,18 @@
const TextEditor = require('./text-editor')
module.exports = class WorkspaceCenter {
constructor (paneContainer) {
constructor ({paneContainer, didActivate, didChangeActivePaneItem}) {
this.paneContainer = paneContainer
this.didActivate = didActivate
this.paneContainer.onDidActivatePane(() => this.didActivate(this))
this.paneContainer.onDidChangeActivePaneItem((item) => {
didChangeActivePaneItem(this, item)
})
}
activate () {}
activate () {
this.getActivePane().activate()
}
getLocation () {
return 'center'