mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Let default attributes have a bigger priority if defined
This commit is contained in:
@@ -109,11 +109,11 @@ public final class TextAttributesKey implements Comparable<TextAttributesKey>, J
|
||||
* @return the text attributes.
|
||||
*/
|
||||
public TextAttributes getDefaultAttributes() {
|
||||
if (myFallbackAttributeKey != null) {
|
||||
TextAttributes fallbackAttributes = myFallbackAttributeKey.getDefaultAttributes();
|
||||
if (fallbackAttributes != null && !fallbackAttributes.isEmpty()) return fallbackAttributes;
|
||||
}
|
||||
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();
|
||||
|
||||
-3
@@ -43,10 +43,7 @@ public class DefaultColorsScheme extends AbstractColorsScheme implements ReadOnl
|
||||
if (key == null) return null;
|
||||
TextAttributes attrs = myAttributesMap.get(key);
|
||||
if (attrs == null) {
|
||||
attrs = getFallbackAttributes(key.getFallbackAttributeKey());
|
||||
if (attrs == null) {
|
||||
attrs = key.getDefaultAttributes();
|
||||
}
|
||||
}
|
||||
return attrs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user