From b59ffb7d417ba978087a1663c002256d684ae49a Mon Sep 17 00:00:00 2001 From: Seivan Heidari Date: Thu, 24 Oct 2019 18:33:36 +0200 Subject: Making it clear we're using default settings. --- editors/code/src/scopes.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'editors') diff --git a/editors/code/src/scopes.ts b/editors/code/src/scopes.ts index a099696a9..607b8b2dd 100644 --- a/editors/code/src/scopes.ts +++ b/editors/code/src/scopes.ts @@ -85,17 +85,13 @@ function loadThemeFile(themePath: string) { } } } -function mergeRuleSettings(defaultRule: TextMateRuleSettings, override: TextMateRuleSettings): TextMateRuleSettings { - const mergedRule = defaultRule; - if (override.background) { - mergedRule.background = override.background - } - if (override.foreground) { - mergedRule.foreground = override.foreground - } - if (override.background) { - mergedRule.fontStyle = override.fontStyle - } +function mergeRuleSettings(defaultSetting: TextMateRuleSettings, override: TextMateRuleSettings): TextMateRuleSettings { + const mergedRule = defaultSetting; + + mergedRule.background = override.background || defaultSetting.background + mergedRule.foreground = override.foreground || defaultSetting.foreground + mergedRule.fontStyle = override.fontStyle || defaultSetting.foreground; + return mergedRule; } -- cgit v1.2.3