mirror of
https://github.com/atom/atom.git
synced 2026-02-06 20:55:33 -05:00
Merge pull request #14108 from atom/fb-mdt-remember-moved-item-positions
🐛 Fix observation of moved items
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