mirror of
https://github.com/atom/atom.git
synced 2026-02-18 02:21:43 -05:00
Handle the 'split' option directly in Workspace::openSingletonSync
This commit is contained in:
@@ -115,15 +115,22 @@ class Workspace extends Model
|
||||
openSingletonSync: (uri, {changeFocus, initialLine, split}={}) ->
|
||||
changeFocus ?= true
|
||||
uri = atom.project.relativize(uri)
|
||||
pane = @paneContainer.paneForUri(uri)
|
||||
|
||||
if pane
|
||||
paneItem = pane.itemForUri(uri)
|
||||
pane.activateItem(paneItem)
|
||||
pane.activate() if changeFocus
|
||||
paneItem
|
||||
if pane = @paneContainer.paneForUri(uri)
|
||||
editor = pane.itemForUri(uri)
|
||||
else
|
||||
@openSync(uri, {changeFocus, initialLine, split})
|
||||
pane = switch split
|
||||
when 'left'
|
||||
@activePane.findLeftmostSibling()
|
||||
when 'right'
|
||||
@activePane.findOrCreateRightmostSibling()
|
||||
else
|
||||
@activePane
|
||||
editor = atom.project.openSync(uri, {initialLine})
|
||||
|
||||
pane.activateItem(editor)
|
||||
pane.activate() if changeFocus
|
||||
editor
|
||||
|
||||
# Public: Reopens the last-closed item uri if it hasn't already been reopened.
|
||||
reopenItemSync: ->
|
||||
|
||||
Reference in New Issue
Block a user