From c35fb90653e33053a54ec0814d770da2be486ccb Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 12 Dec 2014 09:13:57 -0700 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20return=20schema=20defaults=20wh?= =?UTF-8?q?en=20sources=20are=20specified=20in=20Config::get?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/config-spec.coffee | 3 ++- src/config.coffee | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/config-spec.coffee b/spec/config-spec.coffee index 3ff75e405..3eb05a453 100644 --- a/spec/config-spec.coffee +++ b/spec/config-spec.coffee @@ -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", -> diff --git a/src/config.coffee b/src/config.coffee index bffd06110..e9e7843fb 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -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)