From 353b2d1840b8085fd0968b13e44d3f7798b9aa68 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Thu, 10 Nov 2011 11:39:29 -0800 Subject: [PATCH] Document.handler just returns the class, not an instance --- src/atom/document.coffee | 2 +- src/startup.coffee | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/atom/document.coffee b/src/atom/document.coffee index 753aa1fcc..ecc9b45e4 100644 --- a/src/atom/document.coffee +++ b/src/atom/document.coffee @@ -11,7 +11,7 @@ class Document extends Pane @handlers: {} @handler: (path) -> for name, {test, handler} of Document.handlers - return new handler path if test path + return handler if test path null @register: (test) -> Document.handlers[@name] = {test, handler: this} diff --git a/src/startup.coffee b/src/startup.coffee index 58019f6a7..8dcd43502 100644 --- a/src/startup.coffee +++ b/src/startup.coffee @@ -30,8 +30,10 @@ for name, method of atom.app atom[name] = atom.app[name] atom.path = $atomController.path.toString() -atom.document = Document.handler atom.path -atom.document ?= new Editor +if handler = Document.handler atom.path + atom.document = new handler atom.path +else + atom.document = new Editor require 'window' window.startup()