mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Some app errors
This commit is contained in:
@@ -5,6 +5,7 @@ Plugins = require 'plugins'
|
||||
module.exports =
|
||||
class App
|
||||
@windows: []
|
||||
|
||||
@root: OSX.NSBundle.mainBundle.resourcePath
|
||||
|
||||
@activeWindow: null
|
||||
@@ -13,8 +14,8 @@ class App
|
||||
@setActiveWindow new Window controller : WindowController
|
||||
|
||||
# Move this someone more approriate
|
||||
if localStorage.lastOpenedFilename
|
||||
@activeWindow.open(localStorage.lastOpenedFilename)
|
||||
if localStorage.lastOpenedPath
|
||||
@activeWindow.open localStorage.lastOpenedPath
|
||||
|
||||
Plugins.load()
|
||||
@activeWindow.document.ace._emit "loaded"
|
||||
|
||||
@@ -57,11 +57,12 @@ class Editor extends Pane
|
||||
|
||||
save: ->
|
||||
return @saveAs() if not @filename
|
||||
|
||||
|
||||
@removeTrailingWhitespace()
|
||||
File.write @filename, @code()
|
||||
@sessions[@filename] = @ace.getSession()
|
||||
.setDirty false
|
||||
App = require 'app' # Get rid of this!
|
||||
App.activeWindow.setDirty false
|
||||
@ace._emit 'save', { @filename }
|
||||
|
||||
open: (path) ->
|
||||
@@ -93,6 +94,7 @@ class Editor extends Pane
|
||||
saveAs: ->
|
||||
if file = Chrome.savePanel()
|
||||
@filename = file
|
||||
App = require 'app' # Get rid of this!
|
||||
App.activeWindow.setTitle _.last @filename.split '/'
|
||||
@save()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user