From 4e262caee07172a8d641efc0b963aecfa7b8bcb7 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Mon, 7 Nov 2011 08:53:07 -0800 Subject: [PATCH] Let editor decide if it wants to open a file. --- src/editor.coffee | 5 ++++- src/window.coffee | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/editor.coffee b/src/editor.coffee index 0daabd191..e61979627 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -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() diff --git a/src/window.coffee b/src/window.coffee index e0af6f9f1..5a2cde64b 100644 --- a/src/window.coffee +++ b/src/window.coffee @@ -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