From 136a30f1808a8808fadce42fb9e3d9bdacde66fc Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Fri, 4 Sep 2015 10:23:40 -0400 Subject: [PATCH] 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 --- src/workspace.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/workspace.coffee b/src/workspace.coffee index 86e860fe2..55d6604ba 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -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()