mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Trigger buffer-created from Project::addBufferAtIndex
This ensures that any listeners for this event will be notified when a buffer is add via deserialization from a telepath document.
This commit is contained in:
@@ -252,7 +252,6 @@ class Project
|
||||
filePath = @resolve(filePath) if filePath?
|
||||
buffer = new TextBuffer({project: this, filePath, initialText})
|
||||
@addBuffer(buffer)
|
||||
@trigger 'buffer-created', buffer
|
||||
buffer
|
||||
|
||||
# Private:
|
||||
@@ -263,6 +262,7 @@ class Project
|
||||
addBufferAtIndex: (buffer, index, options={}) ->
|
||||
@buffers[index] = buffer
|
||||
@state.get('buffers').insert(index, buffer.getState()) if options.updateState ? true
|
||||
@trigger 'buffer-created', buffer
|
||||
|
||||
# Private: Removes a {TextBuffer} association from the project.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user