add option to choose whether atom rememebers your last windows

This commit is contained in:
Jordan Tucker
2016-03-12 01:49:38 -08:00
parent 8ffcea381e
commit 4e4c85970b
2 changed files with 37 additions and 5 deletions

View File

@@ -506,12 +506,14 @@ class AtomApplication
saveState: (allowEmpty=false) ->
return if @quitting
restorePreviousState = @config.get('core.restorePreviousWindowsOnStart') ? true
states = []
for window in @windows
unless window.isSpec
if loadSettings = window.getLoadSettings()
states.push(initialPaths: loadSettings.initialPaths)
if states.length > 0 or allowEmpty
if restorePreviousState
for window in @windows
unless window.isSpec
if loadSettings = window.getLoadSettings()
states.push(initialPaths: loadSettings.initialPaths)
if states.length > 0 or allowEmpty or not restorePreviousState
@storageFolder.storeSync('application.json', states)
loadState: (options) ->