mirror of
https://github.com/atom/atom.git
synced 2026-02-15 00:55:14 -05:00
Add eachBuffer helper to RootView
This allows extensions to bind a callback to all current and future buffers.
This commit is contained in:
@@ -239,3 +239,10 @@ class RootView extends View
|
||||
|
||||
@on 'editor-open', (e, editor) ->
|
||||
callback(editor)
|
||||
|
||||
eachBuffer: (callback) ->
|
||||
for buffer in @project.getBuffers()
|
||||
callback(buffer)
|
||||
|
||||
@project.on 'new-buffer', (buffer) ->
|
||||
callback(buffer)
|
||||
|
||||
Reference in New Issue
Block a user