Open file when received 'open-file' event.

This event is emitted when the OS X opens files with Atom.
This commit is contained in:
Cheng Zhao
2013-05-30 16:13:25 +08:00
parent 970227e082
commit 941a3d8bf8

View File

@@ -139,6 +139,10 @@ class AtomApplication
app.on 'window-all-closed', ->
app.quit()
app.on 'open-file', (event, filePath) =>
event.preventDefault()
@openPath filePath
ipc.on 'close-without-confirm', (processId, routingId) ->
window = BrowserWindow.fromProcessIdAndRoutingId processId, routingId
window.removeAllListeners 'close'