🐛 Fix observation of moved items

`PaneContainer::onDidAddPaneItem` isn't triggered on moves.
This commit is contained in:
Matthew Dapena-Tretter
2017-03-31 16:37:32 -07:00
parent 22807a1aa3
commit 4ed53578ce
2 changed files with 25 additions and 6 deletions

View File

@@ -296,13 +296,15 @@ module.exports = class Workspace extends Model {
subscribeToMovedItems () {
for (const paneContainer of this.getPaneContainers()) {
paneContainer.onDidAddPaneItem(({item}) => {
if (typeof item.getURI === 'function') {
const uri = item.getURI()
if (uri != null) {
this.itemLocationStore.save(item.getURI(), paneContainer.getLocation())
paneContainer.observePanes(pane => {
pane.onDidAddItem(({item}) => {
if (typeof item.getURI === 'function') {
const uri = item.getURI()
if (uri != null) {
this.itemLocationStore.save(item.getURI(), paneContainer.getLocation())
}
}
}
})
})
}
}