mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Document.handler just returns the class, not an instance
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user