mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
order keys in config.cson alphabetically
This commit is contained in:
@@ -827,6 +827,7 @@ class Config
|
||||
|
||||
allSettings = {'*': @settings}
|
||||
allSettings = _.extend allSettings, @scopedSettingsStore.propertiesForSource(@getUserConfigPath())
|
||||
allSettings = sortObject(allSettings)
|
||||
try
|
||||
CSON.writeFileSync(@configFilePath, allSettings)
|
||||
catch error
|
||||
@@ -1190,6 +1191,13 @@ Config.addSchemaEnforcers
|
||||
isPlainObject = (value) ->
|
||||
_.isObject(value) and not _.isArray(value) and not _.isFunction(value) and not _.isString(value) and not (value instanceof Color)
|
||||
|
||||
sortObject = (value) ->
|
||||
return value unless isPlainObject(value)
|
||||
result = {}
|
||||
for key in Object.keys(value).sort()
|
||||
result[key] = sortObject(value[key])
|
||||
result
|
||||
|
||||
withoutEmptyObjects = (object) ->
|
||||
resultObject = undefined
|
||||
if isPlainObject(object)
|
||||
|
||||
Reference in New Issue
Block a user