Skip to content

Commit

Permalink
Document Workspace::onDidOpen
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Sobo committed Sep 4, 2014
1 parent 9de0ba1 commit aac64e3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/workspace.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ class Workspace extends Model
callback(textEditor) for textEditor in @getTextEditors()
@onDidAddTextEditor ({textEditor}) -> callback(textEditor)

# Essential: Invoke the given callback whenever an item is opened. Unlike
# ::onDidAddPaneItem, observers will be notified for items that are already
# present in the workspace when they are reopened.
#
# * `callback` {Function} to be called whenever an item is opened.
# * `event` {Object} with the following keys:
# * `uri` {String} representing the opened URI. Could be `undefined`.
# * `item` The opened item.
# * `pane` The pane in which the item was opened.
# * `index` The index of the opened item on its pane.
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidOpen: (callback) ->
@emitter.on 'did-open', callback

Expand Down

0 comments on commit aac64e3

Please sign in to comment.