From 8a2f37c2294e2985eb57ae8628e4586b692c548e Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Mon, 3 Jun 2013 16:13:32 +0400 Subject: [PATCH] right color for ProcessOutputTypes.SYSTEM --- .../execution/process/AnsiEscapeDecoder.java | 2 +- .../execution/process/ColoredProcessHandler.java | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/platform/platform-api/src/com/intellij/execution/process/AnsiEscapeDecoder.java b/platform/platform-api/src/com/intellij/execution/process/AnsiEscapeDecoder.java index bad3aa41fdf4..3a45c8d6ee48 100644 --- a/platform/platform-api/src/com/intellij/execution/process/AnsiEscapeDecoder.java +++ b/platform/platform-api/src/com/intellij/execution/process/AnsiEscapeDecoder.java @@ -85,7 +85,7 @@ public class AnsiEscapeDecoder { } private Key getCurrentOutputAttributes(final Key outputType) { - if (outputType == ProcessOutputTypes.STDERR) { + if (outputType == ProcessOutputTypes.STDERR || outputType == ProcessOutputTypes.SYSTEM) { return outputType; } return myCurrentColor != null ? myCurrentColor : outputType; diff --git a/platform/platform-api/src/com/intellij/execution/process/ColoredProcessHandler.java b/platform/platform-api/src/com/intellij/execution/process/ColoredProcessHandler.java index 273f8ff72568..3db9b40651d4 100644 --- a/platform/platform-api/src/com/intellij/execution/process/ColoredProcessHandler.java +++ b/platform/platform-api/src/com/intellij/execution/process/ColoredProcessHandler.java @@ -22,11 +22,9 @@ import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.colors.TextAttributesKey; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.util.Key; -import com.intellij.openapi.util.Pair; import org.jetbrains.annotations.NotNull; import java.nio.charset.Charset; -import java.util.List; /** * @author Roman Chernyatchik @@ -38,10 +36,6 @@ public class ColoredProcessHandler extends OSProcessHandler implements AnsiEscap return EditorColorsManager.getInstance().getGlobalScheme().getAttributes(key); } - // Registering - // TODO use new Maia API in ConsoleViewContentType to apply ANSI color changes without - // restarting RM / Idea + Ruby Plugin - public ColoredProcessHandler(final GeneralCommandLine commandLine) throws ExecutionException { this(commandLine.createProcess(), commandLine.getCommandLineString(), commandLine.getCharset()); } @@ -61,18 +55,16 @@ public class ColoredProcessHandler extends OSProcessHandler implements AnsiEscap } public void coloredTextAvailable(String text, Key attributes) { - textAvailable(text, attributes); + super.notifyTextAvailable(text, attributes); } /** * @deprecated Inheritors should override coloredTextAvailable method - * or implement ColoredChunksAcceptor and override method coloredChunksAvailable to process colored chunks + * or implement {@link com.intellij.execution.process.AnsiEscapeDecoder.ColoredChunksAcceptor} + * and override method coloredChunksAvailable to process colored chunks. + * To be removed in IDEA 14. */ protected void textAvailable(final String text, final Key attributes) { super.notifyTextAvailable(text, attributes); } - - public void processColoredChunks(@NotNull final List> textChunks) { - myAnsiEscapeDecoder.coloredTextAvailable(textChunks, this); - } }