Merge branch 'beta'

This commit is contained in:
Max Brunsfeld 2016-02-02 12:00:08 -08:00
commit 49776d114c
3 changed files with 27 additions and 2 deletions

View File

@ -471,6 +471,27 @@ describe "Workspace", ->
workspace.open("bar://baz").then (item) ->
expect(item).toEqual {bar: "bar://baz"}
it "adds the file to the application's recent documents list", ->
spyOn(atom.applicationDelegate, 'addRecentDocument')
waitsForPromise ->
workspace.open()
runs ->
expect(atom.applicationDelegate.addRecentDocument).not.toHaveBeenCalled()
waitsForPromise ->
workspace.open('something://a/url')
runs ->
expect(atom.applicationDelegate.addRecentDocument).not.toHaveBeenCalled()
waitsForPromise ->
workspace.open(__filename)
runs ->
expect(atom.applicationDelegate.addRecentDocument).toHaveBeenCalledWith(__filename)
it "notifies ::onDidAddTextEditor observers", ->
absolutePath = require.resolve('./fixtures/dir/a')
newEditorHandler = jasmine.createSpy('newEditorHandler')

View File

@ -885,8 +885,6 @@ class AtomEnvironment extends Model
else
@project.addPath(pathToOpen)
@applicationDelegate.addRecentDocument(pathToOpen)
unless fs.isDirectorySync(pathToOpen)
@workspace?.open(pathToOpen, {initialLine, initialColumn})

View File

@ -1,4 +1,5 @@
_ = require 'underscore-plus'
url = require 'url'
path = require 'path'
{join} = path
{Emitter, Disposable, CompositeDisposable} = require 'event-kit'
@ -413,6 +414,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'