From fec8ea42729278e66f1b212bce38f5a7848275d0 Mon Sep 17 00:00:00 2001 From: vegar Date: Tue, 17 Mar 2015 20:09:37 +0100 Subject: [PATCH 1/3] Documentation: workspace.open( ) with no URI I just learned that [calling open on workspace](https://discuss.atom.io/t/how-can-we-help-you-write-packages/4268/67) without specifying an uri is the way to go for getting a new tab with a new document. I can't find anything about this in either the docs or the [api documentation.](https://atom.io/docs/api/v0.187.0/Workspace#instance-open) Should `uri` be marked optional, like the `options` params? And should it be added a line stating that no uri opens a blank editor? (and there's an extra `a` in the title..) --- src/workspace.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/workspace.coffee b/src/workspace.coffee index 49f84f9b8..c8040f920 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -371,9 +371,11 @@ class Workspace extends Model Section: Opening ### - # Essential: Open a given a URI in Atom asynchronously. - # - # * `uri` A {String} containing a URI. + # Essential: Open a given URI in Atom asynchronously. + # If no URI is given, or URI does not resolve to an existing file, + # a new empty text edtior is created. + # + # * `uri` (optional) A {String} containing a URI. # * `options` (optional) {Object} # * `initialLine` A {Number} indicating which row to move the cursor to # initially. Defaults to `0`. From 4cf34cc1fa96d6ad57edffdd16e8d65cbc830783 Mon Sep 17 00:00:00 2001 From: Vegar Vikan Date: Wed, 1 Apr 2015 00:21:59 +0200 Subject: [PATCH 2/3] Documentation: workspace.open( ) refrasing --- src/workspace.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/workspace.coffee b/src/workspace.coffee index c8040f920..6c60cf22a 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -371,8 +371,8 @@ class Workspace extends Model Section: Opening ### - # Essential: Open a given URI in Atom asynchronously. - # If no URI is given, or URI does not resolve to an existing file, + # Essential: Opens the given URI in Atom asynchronously, if it's not already open. + # If no URI is given, or the URI is the path of a file that does not exist, # a new empty text edtior is created. # # * `uri` (optional) A {String} containing a URI. From b8fb2f4d11cd6bdf2bd8b5ec2d01702d42c3cafb Mon Sep 17 00:00:00 2001 From: Ivan Zuzak Date: Thu, 9 Apr 2015 15:38:48 +0200 Subject: [PATCH 3/3] Clarify that URIs don't need to be files --- src/workspace.coffee | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/workspace.coffee b/src/workspace.coffee index 6c60cf22a..e864e2af2 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -371,11 +371,12 @@ class Workspace extends Model Section: Opening ### - # Essential: Opens the given URI in Atom asynchronously, if it's not already open. - # If no URI is given, or the URI is the path of a file that does not exist, - # a new empty text edtior is created. - # - # * `uri` (optional) A {String} containing a URI. + # Essential: Opens the given URI in Atom asynchronously. + # If the URI is already open, the existing item for that URI will be + # activated. If no URI is given, or no registered opener can open + # the URI, a new empty {TextEditor} will be created. + # + # * `uri` (optional) A {String} containing a URI. # * `options` (optional) {Object} # * `initialLine` A {Number} indicating which row to move the cursor to # initially. Defaults to `0`.