Closed zhangzhx closed 6 years ago
Sorry for the delay, I was very busy before the holidays... :-) Thank you for the interest, and for the pull request.
I am not sure I understand what is wrong with the current rendering?
I think that is as expected, no? "I am lucky guy" green, then the exception red, because it is the standard error.
And the proposed fix breaks the multi-line functionality. If you do something like
System.out.println("\033[32mI am very");
System.out.println("very");
System.out.println("very");
System.out.println("lucky guy\033[0m");
then the two "very" outputs should also be green.
But with returning as soon as there is no match it means that the current line gets no colors. And it should get the color from the previous line.
Thanks for the reply. The Exception Stack Trace should look like this:
I think the original code overrides the color palette of the Exception Stack Trace. It's hard to know I can click the target class line for the source code in the previous screenshot. I can update my PR to allow multiple lines match.
Got it!
Has nothing to do with the fact that there is a colored string before or not. Just doing this as the only instruction is enough: int foo = 4 / 0;
I think this is caused by the fact that some output with a link already has color information associated, and my plugin does not account for that, assumes it all comes "clean slate"
This means that the current pull request is not a good fix, the right approach is to to "merge" the existing color info (that is used for the links) with the one generated by the plugin from ANSI escapes.
Thank you for discovering it, I have filed a bug :-)
Here is the issue I have filed: https://github.com/mihnita/ansi-econsole/issues/32
After enabled the plugin, when I have code like below, the console is not rendering the exception stack trace properly. This change fixes this.
Screenshot for the console output