mirror of
https://github.com/atom/atom.git
synced 2026-02-18 02:21:43 -05:00
Return subscription from RootView.eachEditor()
This commit is contained in:
@@ -205,7 +205,9 @@ class RootView extends View
|
||||
# callback - A {Function} to call
|
||||
eachEditor: (callback) ->
|
||||
callback(editor) for editor in @getEditors()
|
||||
@on 'editor:attached', (e, editor) -> callback(editor)
|
||||
attachedCallback = (e, editor) -> callback(editor)
|
||||
@on('editor:attached', attachedCallback)
|
||||
off: => @off('editor:attached', attachedCallback)
|
||||
|
||||
# Fires a callback on each open {EditSession}.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user