diff --git a/src/project.coffee b/src/project.coffee index 8f58ae9f6..6b0ff326b 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -330,8 +330,7 @@ class Project extends Model # Deprecated: delegate eachEditor: (callback) -> deprecate("Use Workspace::eachEditor instead") - callback(editor) for editor in @getEditors() - @on 'editor-created', (editor) -> callback(editor) + atom.workspace.eachEditor(callback) # Deprecated: delegate getEditors: -> diff --git a/src/workspace.coffee b/src/workspace.coffee index 4b3ad1ad1..2322ca4d9 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -60,7 +60,8 @@ class Workspace extends Model # Returns a subscription object with an `.off` method that you can call to # unregister the callback. eachEditor: (callback) -> - atom.project.eachEditor(callback) + callback(editor) for editor in @getEditors() + @on 'editor-created', (editor) -> callback(editor) # Public: Get all current editors in the workspace. #