mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Don’t return schema defaults when sources are specified in Config::get
This commit is contained in:
committed by
Max Brunsfeld
parent
73df017d83
commit
c35fb90653
@@ -44,7 +44,8 @@ describe "Config", ->
|
||||
expect(atom.config.get("x.y", sources: ["a"], scope: [".foo"])).toBe 1
|
||||
expect(atom.config.get("x.y", sources: ["b"], scope: [".foo"])).toBe 2
|
||||
expect(atom.config.get("x.y", sources: ["c"], scope: [".foo"])).toBe 3
|
||||
expect(atom.config.get("x.y", sources: ["x"], scope: [".foo"])).toBe 4
|
||||
# Schema defaults never match a specific source. We could potentially add a special "schema" source.
|
||||
expect(atom.config.get("x.y", sources: ["x"], scope: [".foo"])).toBeUndefined()
|
||||
|
||||
describe "when an 'excludeSources' option is specified", ->
|
||||
it "only retrieves values from the specified sources", ->
|
||||
|
||||
@@ -808,7 +808,7 @@ class Config
|
||||
|
||||
getRawValue: (keyPath, options) ->
|
||||
value = _.valueForKeyPath(@settings, keyPath)
|
||||
defaultValue = _.valueForKeyPath(@defaultSettings, keyPath)
|
||||
defaultValue = _.valueForKeyPath(@defaultSettings, keyPath) unless options?.sources?.length > 0
|
||||
|
||||
if value?
|
||||
value = _.deepClone(value)
|
||||
|
||||
Reference in New Issue
Block a user