mirror of
https://github.com/atom/atom.git
synced 2026-02-07 13:14:55 -05:00
🐛 Fix observation of moved items
`PaneContainer::onDidAddPaneItem` isn't triggered on moves.
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user