Add Editor:onDidSave

This commit is contained in:
Kevin Sawicki
2014-09-15 18:25:29 -07:00
parent 82a906cce5
commit 5c77b06d2a

View File

@@ -257,6 +257,16 @@ class Editor extends Model
onDidInsertText: (callback) ->
@emitter.on 'did-insert-text', callback
# Public: Invoke the given callback after the buffer is saved to disk.
#
# * `callback` {Function} to be called after the buffer is saved.
# * `event` {Object} with the following keys:
# * `path` The path to which the buffer was saved.
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidSave: (callback) ->
@getBuffer().onDidSave(callback)
# Extended: Calls your `callback` when a {Cursor} is added to the editor.
# Immediately calls your callback for each existing cursor.
#