mirror of
https://github.com/atom/atom.git
synced 2026-01-15 01:48:15 -05:00
Ensure pane is added to container before invoking onDidAddPane listeners
Fixes #12654
This commit is contained in:
@@ -220,7 +220,9 @@ describe "PaneContainer", ->
|
||||
it "invokes the given callback when panes are added", ->
|
||||
container = new PaneContainer(params)
|
||||
events = []
|
||||
container.onDidAddPane (event) -> events.push(event)
|
||||
container.onDidAddPane (event) ->
|
||||
expect(event.pane in container.getPanes()).toBe true
|
||||
events.push(event)
|
||||
|
||||
pane1 = container.getActivePane()
|
||||
pane2 = pane1.splitRight()
|
||||
|
||||
@@ -75,12 +75,10 @@ class PaneAxis extends Model
|
||||
@onDidChangeFlexScale(fn)
|
||||
|
||||
addChild: (child, index=@children.length) ->
|
||||
@children.splice(index, 0, child)
|
||||
child.setParent(this)
|
||||
child.setContainer(@container)
|
||||
|
||||
@subscribeToChild(child)
|
||||
|
||||
@children.splice(index, 0, child)
|
||||
@emitter.emit 'did-add-child', {child, index}
|
||||
|
||||
adjustFlexScale: ->
|
||||
|
||||
Reference in New Issue
Block a user