mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Call adjustSplitPanes after setting window state
This commit is contained in:
@@ -87,6 +87,13 @@ describe "RootView", ->
|
||||
expect(editor4.buffer.path).toBe require.resolve('fixtures/sample.txt')
|
||||
expect(editor4.getCursorScreenPosition()).toEqual [0, 2]
|
||||
|
||||
# ensure adjustSplitPanes is called
|
||||
expect(editor1.width()).toBeGreaterThan 0
|
||||
expect(editor2.width()).toBeGreaterThan 0
|
||||
expect(editor3.width()).toBeGreaterThan 0
|
||||
expect(editor4.width()).toBeGreaterThan 0
|
||||
|
||||
|
||||
describe "split editor panes", ->
|
||||
editor1 = null
|
||||
|
||||
|
||||
@@ -90,9 +90,11 @@ class RootView extends View
|
||||
@getWindowState($(elt))
|
||||
|
||||
setWindowState: (windowState, parent) ->
|
||||
adjustSplitPanes = false
|
||||
unless parent
|
||||
@panes.empty()
|
||||
@editors = []
|
||||
adjustSplitPanes = true
|
||||
parent = @panes
|
||||
|
||||
switch windowState.shift()
|
||||
@@ -111,6 +113,8 @@ class RootView extends View
|
||||
for child in windowState
|
||||
@setWindowState(child, column)
|
||||
|
||||
@adjustSplitPanes() if adjustSplitPanes
|
||||
|
||||
addPane: (view, sibling, axis, side) ->
|
||||
unless sibling.parent().hasClass(axis)
|
||||
container = $$ -> @div class: axis
|
||||
|
||||
Reference in New Issue
Block a user