window open is working cool

This commit is contained in:
Corey Johnson
2011-11-10 16:47:54 -08:00
parent fff3e19a50
commit 0300ce263b
3 changed files with 13 additions and 11 deletions

View File

@@ -23,7 +23,8 @@ class Document extends Pane
@path = path if path
atom.trigger 'document:load', this
open: ->
open: (path) ->
@constructor is Document.handler path
close: ->

View File

@@ -78,15 +78,17 @@ class Editor extends Document
null
open: (path) ->
if Editor is Document.handler path
@path = path
@dirty = false
@ace.getSession().setValue code = fs.read @path
@ace.getSession().setUndoManager new UndoManager
mode = @modeForPath()
@ace.getSession().setMode new mode if mode
atom.trigger 'editor:load', this
true
return false if not super
return false if @path
@path = path
@dirty = false
@ace.getSession().setValue code = fs.read @path
@ace.getSession().setUndoManager new UndoManager
mode = @modeForPath()
@ace.getSession().setMode new mode if mode
atom.trigger 'editor:load', this
true
close: ->
if @dirty

View File

@@ -10,7 +10,6 @@ windowAdditions =
startup: ->
@path = atom.path
$atomController.window.makeKeyWindow
shutdown: ->