Add a clarification about the usage of addOpener

Documentation augmented with a note about the need of using fake protocol in
order to invoke opener on a file already opened.

See discussion at

https://discuss.atom.io/t/difficulties-using-atom-workspace-addopener/20444
This commit is contained in:
Andrey Fedorov
2015-09-04 10:23:40 -04:00
parent 6d0ae3f97b
commit 136a30f180

View File

@@ -506,6 +506,12 @@ class Workspace extends Model
#
# Returns a {Disposable} on which `.dispose()` can be called to remove the
# opener.
#
# Note that the opener will be called if and only if the URI is not already open
# in the current pane. The searchAllPanes flag expands the search from the
# current pane to all panes. If the file path is converted from a standard path,
# e.g. /foo/bar/baz.html, to a URI with a fake protocol, e.g. custom://foo/bar/baz.html,
# it wouldn't conflict and the opener will be invoked.
addOpener: (opener) ->
if includeDeprecatedAPIs
packageName = @getCallingPackageName()