diff --git a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/action/ScopeHighlightingAction.kt b/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/action/ScopeHighlightingAction.kt index 45e97a8..dba421e 100644 --- a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/action/ScopeHighlightingAction.kt +++ b/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/action/ScopeHighlightingAction.kt @@ -3,7 +3,6 @@ package com.github.izhangzhihao.rainbow.brackets.action import com.github.izhangzhihao.rainbow.brackets.RainbowInfo import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings import com.github.izhangzhihao.rainbow.brackets.util.alphaBlend -import com.github.izhangzhihao.rainbow.brackets.util.create import com.intellij.codeInsight.highlighting.HighlightManager import com.intellij.openapi.editor.Editor import com.intellij.openapi.editor.colors.EditorColorsManager @@ -25,7 +24,7 @@ class ScopeHighlightingAction : AbstractScopeHighlightingAction() { highlightManager.addRangeHighlight(this, rainbowInfo.startOffset, rainbowInfo.endOffset, - create("ScopeHighlightingAction", attributes), + attributes, false, //hideByTextChange RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey highlighters) diff --git a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/action/ScopeOutsideHighlightingRestrainAction.kt b/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/action/ScopeOutsideHighlightingRestrainAction.kt index c64cf48..3f645ff 100644 --- a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/action/ScopeOutsideHighlightingRestrainAction.kt +++ b/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/action/ScopeOutsideHighlightingRestrainAction.kt @@ -3,7 +3,6 @@ package com.github.izhangzhihao.rainbow.brackets.action import com.github.izhangzhihao.rainbow.brackets.RainbowInfo import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings import com.github.izhangzhihao.rainbow.brackets.util.alphaBlend -import com.github.izhangzhihao.rainbow.brackets.util.create import com.intellij.codeInsight.highlighting.HighlightManager import com.intellij.openapi.editor.Editor import com.intellij.openapi.editor.colors.EditorColorsManager @@ -29,7 +28,7 @@ class ScopeOutsideHighlightingRestrainAction : AbstractScopeHighlightingAction() highlightManager.addRangeHighlight(this, 0, startOffset, - create("ScopeOutsideHighlightingRestrainAction", attributes), + attributes, false, //hideByTextChange RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey highlighters) @@ -41,7 +40,7 @@ class ScopeOutsideHighlightingRestrainAction : AbstractScopeHighlightingAction() highlightManager.addRangeHighlight(this, endOffset, lastOffset, - create("ScopeOutsideHighlightingRestrainAction", attributes), + attributes, false, //hideByTextChange RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey highlighters) diff --git a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/util/TextAttributesKey.kt b/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/util/TextAttributesKey.kt deleted file mode 100644 index f859c07..0000000 --- a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/util/TextAttributesKey.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.github.izhangzhihao.rainbow.brackets.util - -import com.intellij.openapi.editor.colors.TextAttributesKey -import com.intellij.openapi.editor.markup.TextAttributes -import kotlin.reflect.jvm.isAccessible - -fun create(name: String, textAttributes: TextAttributes): TextAttributesKey { - val cons = TextAttributesKey::class.constructors.first { it.parameters.size == 3 } - cons.isAccessible = true - return cons.call(name, textAttributes, null) -} \ No newline at end of file