mirror of
https://github.com/atom/atom.git
synced 2026-02-15 00:55:14 -05:00
Deprecate changeFocus option to Workspace::open
Its documentation was already removed, and it was already deprecated in ::openSync.
This commit is contained in:
@@ -377,11 +377,15 @@ class Workspace extends Model
|
||||
# * `activatePane` A {Boolean} indicating whether to call {Pane::activate} on
|
||||
# the containing pane. Defaults to `true`.
|
||||
openSync: (uri='', options={}) ->
|
||||
deprecate("Don't use the `changeFocus` option") if options.changeFocus?
|
||||
# TODO: Remove deprecated changeFocus option
|
||||
if options.changeFocus?
|
||||
deprecate("The `changeFocus` option has been renamed to `activatePane`")
|
||||
options.activatePane = options.changeFocus
|
||||
delete options.changeFocus
|
||||
|
||||
{initialLine, initialColumn} = options
|
||||
# TODO: Remove deprecated changeFocus option
|
||||
activatePane = options.activatePane ? options.changeFocus ? true
|
||||
activatePane = options.activatePane ? true
|
||||
|
||||
uri = atom.project.resolve(uri)
|
||||
|
||||
item = @activePane.itemForUri(uri)
|
||||
@@ -395,7 +399,13 @@ class Workspace extends Model
|
||||
item
|
||||
|
||||
openUriInPane: (uri, pane, options={}) ->
|
||||
changeFocus = options.changeFocus ? true
|
||||
# TODO: Remove deprecated changeFocus option
|
||||
if options.changeFocus?
|
||||
deprecate("The `changeFocus` option has been renamed to `activatePane`")
|
||||
options.activatePane = options.changeFocus
|
||||
delete options.changeFocus
|
||||
|
||||
activatePane = options.activatePane ? true
|
||||
|
||||
if uri?
|
||||
item = pane.itemForUri(uri)
|
||||
@@ -409,7 +419,7 @@ class Workspace extends Model
|
||||
@paneContainer.root = pane
|
||||
@itemOpened(item)
|
||||
pane.activateItem(item)
|
||||
pane.activate() if changeFocus
|
||||
pane.activate() if activatePane
|
||||
index = pane.getActiveItemIndex()
|
||||
@emit "uri-opened"
|
||||
@emitter.emit 'did-open', {uri, pane, item, index}
|
||||
|
||||
Reference in New Issue
Block a user