Behavior of atom.open and newWindow=false


#1

I’m looking for a description on how atom.open is theoretically supposed to work.
Currently, if you pass an array of paths and newWindow=true into atom.open, it will add each path as a project path in a new window. If the path happens to be a file, its folder will be added as a project path and the file specified will be opened up on the editor.

Calling atom.open with the same paths but with newWindow=false, however, doesn’t seem to prevent atom from opening these paths in a new window. The description in the API docs says “true to always open a new window instead of reusing existing windows depending on the paths to open”. I assume that this means there are cases where the newWindow flag is ignored altogether depending on the paths you pass in, but is there a description of how this is supposed to work?

I am calling it like so:

var options = {};
options.pathsToOpen = ["Path1", "Path2"];
options.newWindow = false;
atom.open(options)

In addition, I would like to load up a list of project paths and a list of open files in the editor independently from each other when using atom.open. For example, I’d like to open up a file in the new Window that is not added to the project folder tree. This doesn’t seem possible currently, but I figured I would ask anyway.


#2

Hi, I also had this problem for Advanced new package. I’ve asked about this here.
As solution I’ve used Atom workspace open instead.


#3

I probably should have searched through the Issues on the project first, so thanks for linking that.
I am currently using the other methods of opening files for the current Window, and was just experimenting when I stumbled across this issues and was curious.