mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
window open is working cool
This commit is contained in:
@@ -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: ->
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -10,7 +10,6 @@ windowAdditions =
|
||||
|
||||
startup: ->
|
||||
@path = atom.path
|
||||
|
||||
$atomController.window.makeKeyWindow
|
||||
|
||||
shutdown: ->
|
||||
|
||||
Reference in New Issue
Block a user