mirror of
https://github.com/atom/atom.git
synced 2026-02-11 15:14:59 -05:00
Don't store default locations
This will probably be less confusing for developers experimenting with changing the default location. Also, we avoid storing extra info we don't really need.
This commit is contained in:
@@ -301,7 +301,17 @@ module.exports = class Workspace extends Model {
|
||||
if (typeof item.getURI === 'function') {
|
||||
const uri = item.getURI()
|
||||
if (uri != null) {
|
||||
this.itemLocationStore.save(item.getURI(), paneContainer.getLocation())
|
||||
const location = paneContainer.getLocation()
|
||||
let defaultLocation
|
||||
if (typeof item.getDefaultLocation === 'function') {
|
||||
defaultLocation = item.getDefaultLocation()
|
||||
}
|
||||
defaultLocation = defaultLocation || 'center'
|
||||
if (location === defaultLocation) {
|
||||
this.itemLocationStore.delete(item.getURI())
|
||||
} else {
|
||||
this.itemLocationStore.save(item.getURI(), location)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user