mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Don't destroy pane if replacing last pending item
Signed-off-by: Michelle Tilley <binarymuse@github.com>
This commit is contained in:
@@ -423,10 +423,6 @@ class Pane extends Model
|
||||
|
||||
return if item in @items
|
||||
|
||||
pendingItem = @getPendingItem()
|
||||
@destroyItem(pendingItem) if pendingItem?
|
||||
@setPendingItem(item) if pending
|
||||
|
||||
if typeof item.onDidDestroy is 'function'
|
||||
itemSubscriptions = new CompositeDisposable
|
||||
itemSubscriptions.add item.onDidDestroy => @removeItem(item, false)
|
||||
@@ -437,6 +433,10 @@ class Pane extends Model
|
||||
@subscriptionsPerItem.set item, itemSubscriptions
|
||||
|
||||
@items.splice(index, 0, item)
|
||||
pendingItem = @getPendingItem()
|
||||
@destroyItem(pendingItem) if pendingItem?
|
||||
@setPendingItem(item) if pending
|
||||
|
||||
@emitter.emit 'did-add-item', {item, index, moved}
|
||||
@setActiveItem(item) unless @getActiveItem()?
|
||||
item
|
||||
|
||||
Reference in New Issue
Block a user