mirror of
https://github.com/atom/atom.git
synced 2026-02-03 11:14:59 -05:00
Fix bug in ::activateItem
Only destroy active item if it is not the same as the new item.
This commit is contained in:
@@ -345,7 +345,7 @@ class Pane extends Model
|
||||
if item?
|
||||
if @activeItem?.isPending?()
|
||||
index = @getActiveItemIndex()
|
||||
@destroyActiveItem()
|
||||
@destroyActiveItem() unless item is @activeItem
|
||||
else
|
||||
index = @getActiveItemIndex() + 1
|
||||
@addItem(item, index, false)
|
||||
@@ -580,7 +580,6 @@ class Pane extends Model
|
||||
# Public: Makes this pane the *active* pane, causing it to gain focus.
|
||||
activate: ->
|
||||
throw new Error("Pane has been destroyed") if @isDestroyed()
|
||||
|
||||
@container?.setActivePane(this)
|
||||
@emitter.emit 'did-activate'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user