Only add local paths to recent documents list

Also, add them in Workspace::open and not AtomEnvironment::openLocations
so that files opened in an existing window will also be added to the
list
This commit is contained in:
Max Brunsfeld
2016-02-02 10:25:23 -08:00
parent e9db64ca91
commit 19349edc7a
3 changed files with 27 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
_ = require 'underscore-plus'
url = require 'url'
path = require 'path'
{join} = path
{Emitter, Disposable, CompositeDisposable} = require 'event-kit'
@@ -409,6 +410,11 @@ class Workspace extends Model
split = options.split
uri = @project.resolvePath(uri)
# Avoid adding URLs as recent documents to work-around this Spotlight crash:
# https://github.com/atom/atom/issues/10071
if uri? and not url.parse(uri).protocol?
@applicationDelegate.addRecentDocument(uri)
pane = @paneContainer.paneForURI(uri) if searchAllPanes
pane ?= switch split
when 'left'