mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Revert "Add Project::onDidCreateBuffer"
This reverts commit 4070e5fb25
.
This commit is contained in:
parent
61fa1c4230
commit
40b32930cf
@ -58,7 +58,7 @@ describe "Project", ->
|
||||
beforeEach ->
|
||||
absolutePath = require.resolve('./fixtures/dir/a')
|
||||
newBufferHandler = jasmine.createSpy('newBufferHandler')
|
||||
atom.project.onDidCreateBuffer newBufferHandler
|
||||
atom.project.on 'buffer-created', newBufferHandler
|
||||
|
||||
describe "when given an absolute path that isn't currently open", ->
|
||||
it "returns a new edit session for the given path and emits 'buffer-created'", ->
|
||||
|
@ -54,21 +54,10 @@ class Project extends Model
|
||||
onDidChangePath: (callback) ->
|
||||
@emitter.on 'did-change-path', callback
|
||||
|
||||
|
||||
# Extended: Invoke the given callback when a new buffer has been created. For
|
||||
# example, when {::open} is called, this is fired.
|
||||
#
|
||||
# * `callback` {Function}
|
||||
# * `buffer` {TextBuffer} the new buffer
|
||||
onDidCreateBuffer: (callback) ->
|
||||
@emitter.on 'did-create-buffer', callback
|
||||
|
||||
on: (eventName) ->
|
||||
switch eventName
|
||||
when 'path-changed'
|
||||
deprecate 'Use Project::onDidChangePath instead'
|
||||
when 'buffer-created'
|
||||
deprecate 'Use Project::onDidCreateBuffer instead'
|
||||
else
|
||||
deprecate 'Project::on is deprecated. Use event subscription methods instead.'
|
||||
EmitterMixin::on.apply(this, arguments)
|
||||
@ -247,7 +236,6 @@ class Project extends Model
|
||||
@buffers.splice(index, 0, buffer)
|
||||
buffer.onDidDestroy => @removeBuffer(buffer)
|
||||
@emit 'buffer-created', buffer
|
||||
@emitter.emit 'did-create-buffer', buffer
|
||||
buffer
|
||||
|
||||
# Removes a {TextBuffer} association from the project.
|
||||
|
Loading…
Reference in New Issue
Block a user