right color for ProcessOutputTypes.SYSTEM

This commit is contained in:
Sergey Simonchik
2013-06-03 16:13:32 +04:00
parent f6078b2839
commit 8a2f37c229
2 changed files with 5 additions and 13 deletions
@@ -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;
@@ -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<Pair<String, Key>> textChunks) {
myAnsiEscapeDecoder.coloredTextAvailable(textChunks, this);
}
}