mirror of
https://github.com/chylex/IntelliJ-Rainbow-Brackets.git
synced 2025-05-31 16:34:06 +02:00
Revert "remove some deprecated API usage"
This reverts commit 2b71a61172
.
This commit is contained in:
parent
48897f6e7a
commit
890df1b02b
src/main/kotlin/com/github/izhangzhihao/rainbow/brackets
@ -3,7 +3,6 @@ package com.github.izhangzhihao.rainbow.brackets.action
|
|||||||
import com.github.izhangzhihao.rainbow.brackets.RainbowInfo
|
import com.github.izhangzhihao.rainbow.brackets.RainbowInfo
|
||||||
import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings
|
import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings
|
||||||
import com.github.izhangzhihao.rainbow.brackets.util.alphaBlend
|
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.codeInsight.highlighting.HighlightManager
|
||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.editor.Editor
|
||||||
import com.intellij.openapi.editor.colors.EditorColorsManager
|
import com.intellij.openapi.editor.colors.EditorColorsManager
|
||||||
@ -25,7 +24,7 @@ class ScopeHighlightingAction : AbstractScopeHighlightingAction() {
|
|||||||
highlightManager.addRangeHighlight(this,
|
highlightManager.addRangeHighlight(this,
|
||||||
rainbowInfo.startOffset,
|
rainbowInfo.startOffset,
|
||||||
rainbowInfo.endOffset,
|
rainbowInfo.endOffset,
|
||||||
create("ScopeHighlightingAction", attributes),
|
attributes,
|
||||||
false, //hideByTextChange
|
false, //hideByTextChange
|
||||||
RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey
|
RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey
|
||||||
highlighters)
|
highlighters)
|
||||||
|
@ -3,7 +3,6 @@ package com.github.izhangzhihao.rainbow.brackets.action
|
|||||||
import com.github.izhangzhihao.rainbow.brackets.RainbowInfo
|
import com.github.izhangzhihao.rainbow.brackets.RainbowInfo
|
||||||
import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings
|
import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings
|
||||||
import com.github.izhangzhihao.rainbow.brackets.util.alphaBlend
|
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.codeInsight.highlighting.HighlightManager
|
||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.editor.Editor
|
||||||
import com.intellij.openapi.editor.colors.EditorColorsManager
|
import com.intellij.openapi.editor.colors.EditorColorsManager
|
||||||
@ -29,7 +28,7 @@ class ScopeOutsideHighlightingRestrainAction : AbstractScopeHighlightingAction()
|
|||||||
highlightManager.addRangeHighlight(this,
|
highlightManager.addRangeHighlight(this,
|
||||||
0,
|
0,
|
||||||
startOffset,
|
startOffset,
|
||||||
create("ScopeOutsideHighlightingRestrainAction", attributes),
|
attributes,
|
||||||
false, //hideByTextChange
|
false, //hideByTextChange
|
||||||
RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey
|
RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey
|
||||||
highlighters)
|
highlighters)
|
||||||
@ -41,7 +40,7 @@ class ScopeOutsideHighlightingRestrainAction : AbstractScopeHighlightingAction()
|
|||||||
highlightManager.addRangeHighlight(this,
|
highlightManager.addRangeHighlight(this,
|
||||||
endOffset,
|
endOffset,
|
||||||
lastOffset,
|
lastOffset,
|
||||||
create("ScopeOutsideHighlightingRestrainAction", attributes),
|
attributes,
|
||||||
false, //hideByTextChange
|
false, //hideByTextChange
|
||||||
RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey
|
RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey
|
||||||
highlighters)
|
highlighters)
|
||||||
|
@ -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)
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user