mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Merge branch 'beta'
This commit is contained in:
commit
49776d114c
@ -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')
|
||||
|
@ -885,8 +885,6 @@ class AtomEnvironment extends Model
|
||||
else
|
||||
@project.addPath(pathToOpen)
|
||||
|
||||
@applicationDelegate.addRecentDocument(pathToOpen)
|
||||
|
||||
unless fs.isDirectorySync(pathToOpen)
|
||||
@workspace?.open(pathToOpen, {initialLine, initialColumn})
|
||||
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user