Closed ydaveluy closed 2 years ago
First, thank you for the PR. But I "would let it sit" for a bit. I already submitted a fix, now I want to test if for a bit before releasing.
The AnsiConsolePreferenceUtils.tryPreservingStdErrColor() is not supported by this implementation. I dont't understand the use case.
The Eclipse console (the one used for running programs) has 3 streams, a standard input, a standard output, and a standard error. The usual POSIX model (stdin, stdout, stderr in C)
They each have different colors associated. If you go to Preferences -- Run/Debug -- Console you can see them (and change the colors)
The tryPreservingStdErrColor
tries to preserve the color of the stderr (usually red)
Printing to stderr goes there (obviously), and the Java exceptions (if not caught, or from e.printStackTrace()
)
You can see it here: https://raw.githubusercontent.com/wiki/mihnita/ansi-econsole/LinksAndStdErr.jpg
Hmm, it also looks like is not handling the link colors anymore (AnsiConsolePreferenceUtils.getHyperlinkColor
)
Also see the screenshot (the blue links in the Java exceptions, taking you to Java classes)
I haven't seen any latency in the console with big outputs.
It is not about big outputs, it is about outputs with a lot of attribute changes. See https://github.com/mihnita/ansi-econsole/issues/27
Sorry, this is to extensive of a change. Should separate bug fixes from big refactoring.
And I see no reason for some of the refactoring other than personal preference. Breaking a few things in the process...
Thank you very much for the attempt. Mihai
Refactor code: split LineStyleListener and PositionUpdater in 2 separates classes.
The AnsiConsolePositionUpdater constructs the positions for the escape codes AND colorized text area. The built AnsiPosition contains the associated StyleRange.
On the other side, the AnsiConsoleStyleListener initialize the PositionUpdater when a new document is processed and update the LyneStyleEvent styles accordingly to the overlapping AnsiPosition.
There was a static AnsiConsoleAttributes variable named current in the AnsiPosition class that provides random color error when many builds are run in parallel. This variable does not exist anymore after this refactoring.
The AnsiConsolePreferenceUtils.tryPreservingStdErrColor() is not supported by this implementation. I dont't understand the use case.
The offsetToStyleRangeCache does not exist anymore. I haven't seen any latency in the console with big outputs.