mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-162844 A simple copy of Default color scheme is flooded with inheritance defining attributes
This commit is contained in:
+10
-12
@@ -34,10 +34,8 @@ public class EditorColorsSchemeImpl extends AbstractColorsScheme implements Exte
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttributes(@NotNull TextAttributesKey key, TextAttributes attributes) {
|
||||
if (attributes == USE_INHERITED_MARKER || !attributes.equals(getAttributes(key))) {
|
||||
myAttributesMap.put(key, attributes);
|
||||
}
|
||||
public void setAttributes(@NotNull TextAttributesKey key, @NotNull TextAttributes attributes) {
|
||||
setAttributes(key, attributes, false);
|
||||
}
|
||||
|
||||
public void setAttributes(@NotNull TextAttributesKey key, @NotNull TextAttributes attributes, boolean force) {
|
||||
@@ -56,17 +54,17 @@ public class EditorColorsSchemeImpl extends AbstractColorsScheme implements Exte
|
||||
@Override
|
||||
public TextAttributes getAttributes(@Nullable TextAttributesKey key) {
|
||||
if (key != null) {
|
||||
TextAttributesKey fallbackKey = key.getFallbackAttributeKey();
|
||||
TextAttributes attributes = getDirectlyDefinedAttributes(key);
|
||||
if (fallbackKey != null) {
|
||||
if (attributes != null && attributes != USE_INHERITED_MARKER) {
|
||||
return attributes;
|
||||
}
|
||||
attributes = getFallbackAttributes(fallbackKey);
|
||||
if (attributes != null && attributes != USE_INHERITED_MARKER) {
|
||||
return attributes;
|
||||
}
|
||||
|
||||
if (attributes != null) {
|
||||
return attributes;
|
||||
TextAttributesKey fallbackKey = key.getFallbackAttributeKey();
|
||||
if (fallbackKey != null) {
|
||||
attributes = getFallbackAttributes(fallbackKey);
|
||||
if (attributes != null) {
|
||||
return attributes;
|
||||
}
|
||||
}
|
||||
}
|
||||
return myParentScheme.getAttributes(key);
|
||||
|
||||
+8
-1
@@ -841,7 +841,14 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
|
||||
if (scheme instanceof EditorColorsSchemeImpl) {
|
||||
((EditorColorsSchemeImpl)scheme).setAttributes(key, isInherited() ? USE_INHERITED_MARKER : getTextAttributes(), !isInherited() && myIsInheritedInitial);
|
||||
if (!isInherited()) {
|
||||
((EditorColorsSchemeImpl)scheme).setAttributes(key, getTextAttributes(), myIsInheritedInitial);
|
||||
}
|
||||
else if (!myIsInheritedInitial) {
|
||||
// set only if previously was not inherited (and, so, we must mark it as inherited)
|
||||
// https://youtrack.jetbrains.com/issue/IDEA-162844
|
||||
scheme.setAttributes(key, USE_INHERITED_MARKER);
|
||||
}
|
||||
}
|
||||
else {
|
||||
scheme.setAttributes(key, isInherited() ? USE_INHERITED_MARKER : getTextAttributes());
|
||||
|
||||
Reference in New Issue
Block a user