mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Destroy any existing pending pane item when adding a pending item
This commit is contained in:
@@ -365,6 +365,12 @@ class Pane extends Model
|
||||
|
||||
return if item in @items
|
||||
|
||||
if item.isPending?()
|
||||
for existingItem, i in @items
|
||||
if existingItem.isPending?()
|
||||
@destroyItem(existingItem)
|
||||
break
|
||||
|
||||
if typeof item.onDidDestroy is 'function'
|
||||
@itemSubscriptions.set item, item.onDidDestroy => @removeItem(item, false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user