1
0
mirror of https://github.com/chylex/IntelliJ-Rainbow-Brackets.git synced 2025-05-12 06:34:03 +02:00

Fix using wrong color schema issue

This commit is contained in:
张志豪 2022-06-06 14:04:29 +08:00
parent ac82ab6ba4
commit 64ded4f5fd
No known key found for this signature in database
GPG Key ID: 9507D6A6DD737384

View File

@ -52,13 +52,13 @@ abstract class RainbowHighlightVisitor : HighlightVisitor {
startElement: PsiElement?,
endElement: PsiElement?) {
val holder = highlightInfoHolder ?: return
@Suppress("USELESS_ELVIS") val schema = holder.colorsScheme ?: EditorColorsManager.getInstance().globalScheme
getHighlightInfo(schema, this, level)
val globalScheme = EditorColorsManager.getInstance().globalScheme
getHighlightInfo(globalScheme, this, level)
?.also {
holder.add(it)
if (startElement != null || endElement != null) {
val color: Color? = it.forcedTextAttributesKey?.defaultAttributes?.foregroundColor
val color: Color? = globalScheme.getAttributes(it.forcedTextAttributesKey)?.foregroundColor
color?.let {
parent?.saveRainbowInfo(level, color, startElement, endElement)
}