|
1 | 1 | package nl.deschepers.laraveltinker.toolwindow
|
2 | 2 |
|
3 | 3 | import com.intellij.openapi.editor.DefaultLanguageHighlighterColors
|
| 4 | +import com.intellij.openapi.editor.HighlighterColors |
| 5 | +import com.intellij.openapi.editor.colors.EditorColorsManager |
4 | 6 | import com.intellij.openapi.wm.ToolWindow
|
5 | 7 | import nl.deschepers.laraveltinker.Strings
|
6 | 8 | import nl.deschepers.laraveltinker.settings.GlobalSettingsState
|
@@ -83,7 +85,7 @@ class TinkerOutputToolwindow(private val toolWindow: ToolWindow) {
|
83 | 85 | }
|
84 | 86 |
|
85 | 87 | private fun updateView() {
|
86 |
| - val color = toHex(DefaultLanguageHighlighterColors.LABEL.defaultAttributes.foregroundColor) |
| 88 | + val color = toHex(HighlighterColors.TEXT.defaultAttributes.foregroundColor ?: Color.BLACK) |
87 | 89 | val timeString = if (pluginSettings.showExecutionStarted) Strings.get("lt.started.at", outputTime) else ""
|
88 | 90 | val highlightedOutput = highlightSyntax("\n" + sanitizeOutput(outputText))
|
89 | 91 |
|
@@ -138,10 +140,10 @@ class TinkerOutputToolwindow(private val toolWindow: ToolWindow) {
|
138 | 140 | }
|
139 | 141 |
|
140 | 142 | private fun highlightSyntax(text: String): String {
|
141 |
| - val stringColor = DefaultLanguageHighlighterColors.STRING.defaultAttributes.foregroundColor |
142 |
| - val numberColor = DefaultLanguageHighlighterColors.NUMBER.defaultAttributes.foregroundColor |
| 143 | + val stringColor = DefaultLanguageHighlighterColors.STRING.defaultAttributes.foregroundColor ?: Color.BLACK |
| 144 | + val numberColor = DefaultLanguageHighlighterColors.NUMBER.defaultAttributes.foregroundColor ?: Color.BLACK |
143 | 145 | val propColor = DefaultLanguageHighlighterColors.INSTANCE_FIELD.defaultAttributes
|
144 |
| - .foregroundColor |
| 146 | + .foregroundColor ?: Color.BLACK |
145 | 147 |
|
146 | 148 | val regex = Regex("(.*\n=>)(.*)", RegexOption.DOT_MATCHES_ALL)
|
147 | 149 |
|
|
0 commit comments