adding support for splitright and splitbelow

This commit is contained in:
Xiaolong Wang 2016-03-18 14:09:14 -05:00
parent 145446b8de
commit fdd8b36e62
2 changed files with 43 additions and 12 deletions

View file

@ -258,13 +258,23 @@ class Ex
filePaths = args.split(' ')
filePaths = undefined if filePaths.length is 1 and filePaths[0] is ''
pane = atom.workspace.getActivePane()
if filePaths? and filePaths.length > 0
newPane = pane.splitUp()
for file in filePaths
do ->
atom.workspace.openURIInPane file, newPane
if atom.config.get('ex-mode.splitbelow')
if filePaths? and filePaths.length > 0
newPane = pane.splitDown()
for file in filePaths
do ->
atom.workspace.openURIInPane file, newPane
else
pane.splitDown(copyActiveItem: true)
else
pane.splitUp(copyActiveItem: true)
if filePaths? and filePaths.length > 0
newPane = pane.splitUp()
for file in filePaths
do ->
atom.workspace.openURIInPane file, newPane
else
pane.splitUp(copyActiveItem: true)
sp: (args) => @split(args)
@ -335,13 +345,22 @@ class Ex
filePaths = args.split(' ')
filePaths = undefined if filePaths.length is 1 and filePaths[0] is ''
pane = atom.workspace.getActivePane()
if filePaths? and filePaths.length > 0
newPane = pane.splitLeft()
for file in filePaths
do ->
atom.workspace.openURIInPane file, newPane
if atom.config.get('ex-mode.splitright')
if filePaths? and filePaths.length > 0
newPane = pane.splitRight()
for file in filePaths
do ->
atom.workspace.openURIInPane file, newPane
else
pane.splitRight(copyActiveItem: true)
else
pane.splitLeft(copyActiveItem: true)
if filePaths? and filePaths.length > 0
newPane = pane.splitLeft()
for file in filePaths
do ->
atom.workspace.openURIInPane file, newPane
else
pane.splitLeft(copyActiveItem: true)
vsp: (args) => @vsplit(args)