How to reference a new tab opened via


Hi there.

I’m writing a package and I’m using to add a new tab (or pane) to show there the content, but the problem I have is that I don’t know how I can add the content because I don’t know how to get the reference to it.

I have seen that exists atom-space-pen-views but is deprecated and I would like to use (if it’s possible) another option.

#2 returns a Promise which resolves into a TextEditor after it has been created successfully. The easiest way to get this is to use promise.then(), like so:, options).then( (newEditor) -> {


I think this not what I want. I’m sorry for not explaining all before.

The package I’m doing uses atom-select-list to choose any of the options that will be available and when the user selects one it opens and uri using

didConfirmSelection: data => {`my-package-uri://${}`, { data });

On the activate() method from my main file I add an opener:

return atom.workspace.addOpener((uri, options) => {
  if (!uri.match(/my\-package\-uri/)) {

  new MyPackageView(options);


I don’t feel like I can see enough of the picture to change my original supposition. Where in your package’s workflow does it need to find a specific editor? You don’t have to maintain the reference if you can easily find it again, or you might need to change some things if you really want to maintain the reference.