mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Call PaneContainer::itemAdded from PaneContainer::reopenItem
This ensures the active item in the new root is filtered out of the reopen stack, preventing a duplicate item from being opened.
This commit is contained in:
@@ -149,6 +149,12 @@ describe "PaneContainer", ->
|
||||
expect(container.reopenItem()).toBeFalsy()
|
||||
expect(pane1.activeItem).toEqual item3
|
||||
|
||||
pane1.destroyItem(item3)
|
||||
container.setRoot(new Pane(item3))
|
||||
expect(container.reopenItem()).toBeFalsy()
|
||||
expect(container.getActivePane().getItems().length).toBe 1
|
||||
expect(container.getActivePaneItem()).toEqual item3
|
||||
|
||||
describe ".saveAll()", ->
|
||||
it "saves all open pane items", ->
|
||||
pane1.showItem(new TestView('4'))
|
||||
|
||||
@@ -96,7 +96,9 @@ class PaneContainer extends View
|
||||
|
||||
setRoot: (root) ->
|
||||
@empty()
|
||||
@append(root) if root?
|
||||
if root?
|
||||
@append(root)
|
||||
@itemAdded(root.activeItem) if root.activeItem
|
||||
@state.set(root: root?.getState())
|
||||
|
||||
removeChild: (child) ->
|
||||
|
||||
Reference in New Issue
Block a user