mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 07:58:04 +03:00
Add pane:close-other-items
This commit is contained in:
parent
4b8d786d2a
commit
f23d9091f2
@ -278,6 +278,13 @@ describe "Pane", ->
|
||||
expect(editSession2.destroyed).toBeTruthy()
|
||||
expect(editSession1.destroyed).toBeTruthy()
|
||||
|
||||
describe "pane:close-other-items", ->
|
||||
it "destroys all items except the current", ->
|
||||
pane.showItem(editSession1)
|
||||
pane.trigger 'pane:close-other-items'
|
||||
expect(editSession2.destroyed).toBeTruthy()
|
||||
expect(pane.getItems()).toEqual [editSession1]
|
||||
|
||||
describe "core:save", ->
|
||||
describe "when the current item has a path", ->
|
||||
describe "when the current item has a save method", ->
|
||||
|
@ -31,6 +31,7 @@ class Pane extends View
|
||||
@command 'pane:split-up', => @splitUp()
|
||||
@command 'pane:split-down', => @splitDown()
|
||||
@command 'pane:close', => @destroyItems()
|
||||
@command 'pane:close-other-items', => @destroyInactiveItems()
|
||||
@on 'focus', => @activeView.focus(); false
|
||||
@on 'focusin', => @makeActive()
|
||||
|
||||
@ -112,6 +113,9 @@ class Pane extends View
|
||||
destroyItems: ->
|
||||
@destroyItem(item) for item in @getItems()
|
||||
|
||||
destroyInactiveItems: ->
|
||||
@destroyItem(item) for item in @getItems() when item isnt @activeItem
|
||||
|
||||
promptToSaveItem: (item, nextAction) ->
|
||||
path = item.getPath()
|
||||
atom.confirm(
|
||||
|
Loading…
Reference in New Issue
Block a user