mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
Make Pane close the current item when handling 'core:close' event
This commit is contained in:
committed by
probablycorey
parent
11a702a2a6
commit
bd8ec81b1e
@@ -20,6 +20,7 @@ class Pane extends View
|
||||
@viewsByClassName = {}
|
||||
@showItem(@items[0])
|
||||
|
||||
@command 'core:close', @removeCurrentItem
|
||||
@command 'pane:show-next-item', @showNextItem
|
||||
@command 'pane:show-previous-item', @showPreviousItem
|
||||
@command 'pane:split-left', => @splitLeft()
|
||||
@@ -65,6 +66,9 @@ class Pane extends View
|
||||
@items.splice(@getCurrentItemIndex() + 1, 0, item)
|
||||
item
|
||||
|
||||
removeCurrentItem: =>
|
||||
@removeItem(@currentItem)
|
||||
|
||||
removeItem: (item) ->
|
||||
@showNextItem() if item is @currentItem and @items.length > 1
|
||||
_.remove(@items, item)
|
||||
|
||||
Reference in New Issue
Block a user