mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Let editor decide if it wants to open a file.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user