mirror of
https://github.com/atom/atom.git
synced 2026-02-16 01:25:13 -05:00
Intelligently activate new items when the active item is closed
If the active item was the pane's first item, the second item (which is the new first item) is activated. Otherwise, the item to the left of the closed item is activated.
This commit is contained in:
@@ -158,8 +158,10 @@ class Pane extends Model
|
||||
if item is @activeItem
|
||||
if @items.length is 1
|
||||
@activeItem = undefined
|
||||
else
|
||||
else if index is 0
|
||||
@activateNextItem()
|
||||
else
|
||||
@activatePreviousItem()
|
||||
@items.splice(index, 1)
|
||||
@emit 'item-removed', item, index, destroying
|
||||
@container?.itemDestroyed(item) if destroying
|
||||
|
||||
Reference in New Issue
Block a user