Let editor decide if it wants to open a file.

This commit is contained in:
Corey Johnson
2011-11-07 08:53:07 -08:00
parent 8e56bf8a6e
commit 4e262caee0
2 changed files with 5 additions and 4 deletions

View File

@@ -34,7 +34,10 @@ class Editor
@ace.setShowInvisibles(true)
@ace.setPrintMarginColumn 78
Event.on 'window:open', (e) => @addBuffer e.details
Event.on 'window:open', (e) =>
path = e.details
@addBuffer e.details if fs.isFile path
Event.on 'window:close', (e) => @removeBuffer e.details
Event.on 'editor:bufferFocus', (e) => @resize()

View File

@@ -82,9 +82,7 @@ windowAdditions =
# Do open and close even belong here?
open: (path) ->
atomController.window.makeKeyAndOrderFront atomController
if not fs.isDirectory path
Event.trigger 'window:open', path
Event.trigger 'window:open', path
close: (path) ->
extension.shutdown() for name, extension of @extensions