Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
934a4de8
Commit
934a4de8
authored
7 years ago
by
Gregory.Shrago
Browse files
Options
Download
Email Patches
Plain Diff
introduce color-key fallback key as in text-attributes-key 2
parent
b8970e7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java
+1
-1
...llij/openapi/editor/colors/impl/AbstractColorsScheme.java
platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java
+10
-7
...ellij/openapi/editor/colors/impl/DefaultColorsScheme.java
with
11 additions
and
8 deletions
+11
-8
platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java
+
1
-
1
View file @
934a4de8
...
...
@@ -714,7 +714,7 @@ public abstract class AbstractColorsScheme extends EditorFontCacheImpl implement
Color
parent
=
parentScheme
instanceof
DefaultColorsScheme
?
((
DefaultColorsScheme
)
parentScheme
).
getColor
(
key
,
false
)
:
parentScheme
.
getColor
(
key
);
return
Comparing
.
equal
(
parent
,
color
);
return
Comparing
.
equal
(
parent
,
color
==
NULL_COLOR_MARKER
?
null
:
color
);
}
).
toList
());
}
...
...
This diff is collapsed.
Click to expand it.
platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java
+
10
-
7
View file @
934a4de8
...
...
@@ -21,7 +21,6 @@ import com.intellij.openapi.editor.colors.TextAttributesKey;
import
com.intellij.openapi.editor.markup.TextAttributes
;
import
com.intellij.openapi.options.SchemeManager
;
import
com.intellij.openapi.options.SchemeState
;
import
com.intellij.util.ObjectUtils
;
import
org.jdom.Element
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
...
...
@@ -47,11 +46,13 @@ public class DefaultColorsScheme extends AbstractColorsScheme implements ReadOnl
if
(
attrs
!=
null
)
return
attrs
;
TextAttributesKey
fallbackKey
=
key
.
getFallbackAttributeKey
();
TextAttributes
fallback
=
fallbackKey
==
null
?
null
:
myAttributesMap
.
get
(
fallbackKey
);
TextAttributes
fallbackDefaults
=
fallbackKey
==
null
?
null
:
getKeyDefaults
(
fallbackKey
);
TextAttributes
fallback
=
fallbackKey
==
null
?
null
:
getFallbackAttributes
(
fallbackKey
);
if
(
fallback
!=
null
&&
fallback
!=
AbstractColorsScheme
.
INHERITED_ATTRS_MARKER
)
return
fallback
;
return
useDefaults
?
ObjectUtils
.
chooseNotNull
(
getKeyDefaults
(
key
),
fallbackDefaults
)
:
null
;
if
(!
useDefaults
)
return
null
;
TextAttributes
keyDefaults
=
getKeyDefaults
(
key
);
if
(
keyDefaults
!=
null
)
return
keyDefaults
;
return
fallbackKey
==
null
?
null
:
getKeyDefaults
(
fallbackKey
);
}
@Nullable
...
...
@@ -71,11 +72,13 @@ public class DefaultColorsScheme extends AbstractColorsScheme implements ReadOnl
if
(
color
!=
null
)
return
color
;
ColorKey
fallbackKey
=
key
.
getFallbackColorKey
();
Color
fallback
=
fallbackKey
==
null
?
null
:
myColorsMap
.
get
(
fallbackKey
);
Color
fallbackDefault
=
fallbackKey
==
null
?
null
:
fallbackKey
.
getDefaultColor
();
Color
fallback
=
fallbackKey
==
null
?
null
:
getFallbackColor
(
fallbackKey
);
if
(
fallback
!=
null
&&
fallback
!=
AbstractColorsScheme
.
INHERITED_COLOR_MARKER
)
return
fallback
;
return
useDefaults
?
ObjectUtils
.
chooseNotNull
(
key
.
getDefaultColor
(),
fallbackDefault
)
:
null
;
if
(!
useDefaults
)
return
null
;
Color
keyDefaults
=
key
.
getDefaultColor
();
if
(
keyDefaults
!=
null
)
return
keyDefaults
;
return
fallbackKey
==
null
?
null
:
fallbackKey
.
getDefaultColor
();
}
@Override
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment