Revert "Add Project::onDidCreateBuffer"

This reverts commit 4070e5fb25.
This commit is contained in:
Ben Ogle 2014-09-10 11:55:41 -07:00
parent 61fa1c4230
commit 40b32930cf
2 changed files with 1 additions and 13 deletions

View File

@ -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'", ->

View File

@ -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.