mirror of
https://github.com/atom/atom.git
synced 2026-02-17 18:11:29 -05:00
Move eachEditor and getEditors to Workspace
This commit is contained in:
@@ -49,6 +49,18 @@ class Workspace extends Model
|
||||
paneContainer: @paneContainer.serialize()
|
||||
fullScreen: atom.isFullScreen()
|
||||
|
||||
# Public: Calls callback for every existing {Editor} and for all new {Editors}
|
||||
# that are created.
|
||||
#
|
||||
# callback - A {Function} with an {Editor} as its only argument
|
||||
eachEditor: (callback) ->
|
||||
callback(editor) for editor in @getEditors()
|
||||
@on 'editor-created', (editor) -> callback(editor)
|
||||
|
||||
# Public: Returns an {Array} of all open {Editor}s.
|
||||
getEditors: ->
|
||||
new Array(atom.project.editors...)
|
||||
|
||||
# Public: Asynchronously opens a given a filepath in Atom.
|
||||
#
|
||||
# uri - A {String} uri.
|
||||
|
||||
Reference in New Issue
Block a user