mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Add Editor:onDidSave
This commit is contained in:
@@ -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.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user