mirror of
https://github.com/atom/atom.git
synced 2026-02-08 13:45:09 -05:00
Emit {will,did}SavePath on ipcMain before/after a buffer is saved
This commit is contained in:
@@ -21,7 +21,7 @@ class Project extends Model
|
||||
Section: Construction and Destruction
|
||||
###
|
||||
|
||||
constructor: ({@notificationManager, packageManager, config}) ->
|
||||
constructor: ({@notificationManager, packageManager, config, @applicationDelegate}) ->
|
||||
@emitter = new Emitter
|
||||
@buffers = []
|
||||
@paths = []
|
||||
@@ -390,6 +390,8 @@ class Project extends Model
|
||||
@on 'buffer-created', (buffer) -> callback(buffer)
|
||||
|
||||
subscribeToBuffer: (buffer) ->
|
||||
buffer.onWillSave ({path}) => @applicationDelegate.emitWillSavePath(path)
|
||||
buffer.onDidSave ({path}) => @applicationDelegate.emitDidSavePath(path)
|
||||
buffer.onDidDestroy => @removeBuffer(buffer)
|
||||
buffer.onDidChangePath =>
|
||||
unless @getPaths().length > 0
|
||||
|
||||
Reference in New Issue
Block a user