mirror of
https://github.com/atom/atom.git
synced 2026-02-19 02:44:29 -05:00
Adhere to the schemas when loading the user’s config
This commit is contained in:
@@ -1032,8 +1032,19 @@ class Config
|
||||
|
||||
resetUserScopedSettings: (newScopedSettings) ->
|
||||
source = @getUserConfigPath()
|
||||
priority = @priorityForSource(source)
|
||||
@scopedSettingsStore.removePropertiesForSource(source)
|
||||
@scopedSettingsStore.addProperties(source, newScopedSettings, priority: @priorityForSource(source))
|
||||
|
||||
for scopeSelector, settings of newScopedSettings
|
||||
validatedSettings = {}
|
||||
try
|
||||
settings = withoutEmptyObjects(@makeValueConformToSchema(null, settings))
|
||||
validatedSettings[scopeSelector] = settings
|
||||
catch e
|
||||
;
|
||||
|
||||
@scopedSettingsStore.addProperties(source, validatedSettings, {priority}) if validatedSettings[scopeSelector]
|
||||
|
||||
@emitChangeEvent()
|
||||
|
||||
addScopedSettings: (source, selector, value, options) ->
|
||||
|
||||
Reference in New Issue
Block a user