Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lib/layout-manager.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,18 @@ module.exports =
move: (orientation, delta) ->
pane = atom.workspace.getActivePane()
[axis,child] = @getAxis pane, orientation
if axis?
target = @getRelativePane axis, child, delta
splitNewPane = false

if !axis
newPaneDirection = if orientation == 'horizontal' then delta == 1 && 'right' || 'left' else delta == 1 && 'up' || 'down'
atom.workspaceView.getActivePane().trigger 'pane:split-' + newPaneDirection
[axis, child] = @getAxis pane, orientation
splitNewPane = true
target = @getRelativePane axis, child, delta
if target?
@swapEditor pane, target
if splitNewPane
target.removeItem target.getActiveItem()

swapEditor: (source, target) ->
editor = source.getActiveItem()
Expand All @@ -63,7 +71,7 @@ module.exports =
axis = pane.parent
child = pane
while true
return unless axis.constructor.name == 'PaneAxis'
return [null, null] unless axis.constructor.name == 'PaneAxis'
break if axis.orientation == orientation
child = axis
axis = axis.parent
Expand Down