From 146751af496d6c304796af8b4e067e87afa1e402 Mon Sep 17 00:00:00 2001 From: Rustam Vishnyakov Date: Fri, 18 Jan 2013 18:08:22 +0400 Subject: [PATCH] Do not use fallback attributes when retrieving default values. --- .../intellij/openapi/editor/colors/TextAttributesKey.java | 4 ---- .../openapi/editor/colors/impl/DefaultColorsScheme.java | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/core-api/src/com/intellij/openapi/editor/colors/TextAttributesKey.java b/platform/core-api/src/com/intellij/openapi/editor/colors/TextAttributesKey.java index f68ad6221428..0b04f72590a9 100644 --- a/platform/core-api/src/com/intellij/openapi/editor/colors/TextAttributesKey.java +++ b/platform/core-api/src/com/intellij/openapi/editor/colors/TextAttributesKey.java @@ -110,10 +110,6 @@ public final class TextAttributesKey implements Comparable, J */ public TextAttributes getDefaultAttributes() { if (myDefaultAttributes == NULL_ATTRIBUTES) { - if (myFallbackAttributeKey != null) { - TextAttributes fallbackAttributes = myFallbackAttributeKey.getDefaultAttributes(); - if (fallbackAttributes != null && !fallbackAttributes.isEmpty()) return fallbackAttributes; - } // E.g. if one text key reuse default attributes of some other predefined key myDefaultAttributes = null; final TextAttributeKeyDefaultsProvider provider = ourDefaultsProvider.getValue(); diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java b/platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java index 7f996360d6eb..004f08c9178b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java @@ -43,7 +43,11 @@ public class DefaultColorsScheme extends AbstractColorsScheme implements ReadOnl if (key == null) return null; TextAttributes attrs = myAttributesMap.get(key); if (attrs == null) { - attrs = key.getDefaultAttributes(); + if (key.getFallbackAttributeKey() != null) { + attrs = getFallbackAttributes(key.getFallbackAttributeKey()); + if (attrs != null && !attrs.isFallbackEnabled()) return attrs; + } + attrs = key.getDefaultAttributes(); } return attrs; }